Skip to content

Commit 5e51261

Browse files
committed
ensure that ticks are colored correctly
1 parent 7a0027d commit 5e51261

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

src/artisanlib/canvas.py

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9080,7 +9080,11 @@ def redraw_keep_view(self, *args:bool, **kwargs:bool) -> None:
90809080
if self.delta_ax is not None:
90819081
zlimit_min, zlimit = self.delta_ax.get_ylim()
90829082
# redraw
9083+
9084+
start = libtime.time()
90839085
self.redraw(*args, **kwargs)
9086+
_log.debug('PRINT redraw -> %s',libtime.time() - start)
9087+
90849088
if self.ax is not None and xlimit_min is not None and xlimit is not None and ylimit_min is not None and ylimit is not None:
90859089
# restore the view
90869090
self.ax.set_xlim(xlimit_min, xlimit)
@@ -9140,25 +9144,23 @@ def redraw(self, recomputeAllDeltas:bool = True, re_smooth_foreground:bool = Tru
91409144
ylabel_alpha_color = to_hex(to_rgba(self.palette['ylabel'], 0.47), keep_alpha=True)
91419145

91429146
if forceRenewAxis or self.ax is None:
9143-
rcParams['axes.linewidth'] = 0.8
9144-
rcParams['xtick.major.size'] = 6
9145-
rcParams['xtick.major.width'] = 1
9146-
rcParams['xtick.minor.width'] = 0.8
9147-
9148-
rcParams['ytick.major.size'] = 4
9149-
rcParams['ytick.major.width'] = 1
9150-
rcParams['ytick.minor.width'] = 1
9151-
9152-
rcParams['xtick.color'] = xlabel_alpha_color
9153-
rcParams['ytick.color'] = ylabel_alpha_color
91549147
#rcParams['text.antialiased'] = True
9155-
91569148
self.fig.clf()
9157-
91589149
self.ax = self.fig.add_subplot(111,facecolor=self.palette['background'])
91599150
self.ax.set_autoscale_on(False)
91609151
self.delta_ax = self.ax.twinx()
91619152

9153+
# rcParams need to be set each redraw. Why?
9154+
# rcParams['axes.linewidth'] = 0.8
9155+
# rcParams['xtick.major.size'] = 6
9156+
# rcParams['xtick.major.width'] = 1
9157+
# rcParams['xtick.minor.width'] = 0.8
9158+
# rcParams['ytick.major.size'] = 4
9159+
# rcParams['ytick.major.width'] = 1
9160+
# rcParams['ytick.minor.width'] = 1
9161+
rcParams['xtick.color'] = xlabel_alpha_color
9162+
rcParams['ytick.color'] = ylabel_alpha_color
9163+
91629164
# instead to remove and regenerate the axis object (we just clear and reuse it)
91639165

91649166
if self.ax is not None:
@@ -11062,6 +11064,7 @@ def redraw(self, recomputeAllDeltas:bool = True, re_smooth_foreground:bool = Tru
1106211064

1106311065
if not self.flagon and self.timeindex[6] and self.AUCshowFlag:
1106411066
self.drawAUC()
11067+
1106511068
#update label rotating_colors
1106611069
for label in self.ax.xaxis.get_ticklabels():
1106711070
label.set_color(self.palette['xlabel'])

0 commit comments

Comments
 (0)