From 3c8e944c4548d6af5d26db8d7a25a780ad96f9c5 Mon Sep 17 00:00:00 2001 From: MiZuii Date: Wed, 18 Dec 2024 21:14:06 +0100 Subject: [PATCH] auto generation border fixes --- src/editor/artists.py | 6 +++++- src/main.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/editor/artists.py b/src/editor/artists.py index 2fba856..4da0741 100644 --- a/src/editor/artists.py +++ b/src/editor/artists.py @@ -5,6 +5,7 @@ from matplotlib.collections import LineCollection from typing import List, Tuple from matplotlib.backend_bases import ResizeEvent +from matplotlib.pyplot import setp # from .hull_generator import calc_hull, parse_solution_to_editor_hull from ..generator.hull_generator import calc_hull, parse_solution_to_editor_hull @@ -619,7 +620,7 @@ def show_labels(self, ax: Axes): # ------------------------------ DRAW DEFINITION ----------------------------- # -def draw(self, ax: Axes) -> None: +def draw(self, ax: Axes, auto_generation: bool = False) -> None: # ax.clear() #maybe not needed, it removes info text # draw points @@ -663,6 +664,9 @@ def draw(self, ax: Axes) -> None: ax.set_xlim(-190, 190) ax.set_ylim(-150, 150) + if auto_generation: + setp(ax, frame_on=False) + plt.draw() logging.info(f"State redraw") diff --git a/src/main.py b/src/main.py index 5bd4da4..96e3d19 100644 --- a/src/main.py +++ b/src/main.py @@ -175,7 +175,7 @@ def draw_maps(raw_data: Union[str, Experiment], st = State(state_dict) StateLinker.link_state(st) - st.draw(ax) + st.draw(ax, True) bbox = ax.get_tightbbox().transformed(fig.dpi_scale_trans.inverted())