From d771ba00018539be6ce8d843d6eec4695cdbeca8 Mon Sep 17 00:00:00 2001 From: Corran Webster Date: Mon, 15 May 2023 15:00:08 +0100 Subject: [PATCH] Update textplot when color, font or other aesthetics change. --- chaco/plots/text_plot.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/chaco/plots/text_plot.py b/chaco/plots/text_plot.py index 5303accaf..9eb933a77 100644 --- a/chaco/plots/text_plot.py +++ b/chaco/plots/text_plot.py @@ -34,25 +34,25 @@ class TextPlot(BaseXYPlot): text = Instance(ArrayDataSource) #: The font of the tick labels. - text_font = KivaFont("modern 10") + text_font = KivaFont("modern 10", redraw=True) #: The color of the tick labels. - text_color = black_color_trait + text_color = black_color_trait(redraw=True) #: The rotation of the tick labels. - text_rotate_angle = Float(0) + text_rotate_angle = Float(0, redraw=True) #: The margin around the label. - text_margin = Int(2) + text_margin = Int(2, redraw=True) #: horizontal position of text relative to target point - h_position = Enum("center", "left", "right") + h_position = Enum("center", "left", "right", redraw=True) #: vertical position of text relative to target point - v_position = Enum("center", "top", "bottom") + v_position = Enum("center", "top", "bottom", redraw=True) #: offset of text relative to non-index direction in pixels - text_offset = Tuple(Float, Float) + text_offset = Tuple(Float, Float, redraw=True) # ------------------------------------------------------------------------ # Private traits @@ -173,6 +173,6 @@ def _invalidate(self, event): self._screen_cache_valid = False self._label_cache_valid = False - @observe("value.data_changed") + @observe("value.data_changed,+redraw") def _invalidate_labels(self, event): self._label_cache_valid = False