diff --git a/plotter.py b/plotter.py index f06c024..b551bfd 100644 --- a/plotter.py +++ b/plotter.py @@ -649,6 +649,8 @@ class Plotter(Aggregator, BaseProcessor): axes=True, colorbar=True, embeded=False, + axes_indicator=None, + overtext_color="w", **kwargs, ): """ @@ -666,6 +668,9 @@ class Plotter(Aggregator, BaseProcessor): # Put a scalebar by default if scalebar is None: scalebar = True + if axes_indicator is None: + axes_indicator = True + if center_space: center = self.current_processor.get_attribute("/maps", "center") @@ -709,11 +714,21 @@ class Plotter(Aggregator, BaseProcessor): f"{scalebar_size} {unit_str(unit_space)[2:-1]}", "lower left", pad=1, - color="white", + color=overtext_color, frameon=False, ) plt.gca().add_artist(scalebar) - + + if axes_indicator: + # A liitle drawing saying what are the axes + plt.annotate('', xy=(0.97, 0.1), xycoords='axes fraction', xytext=(0.865, 0.1), + arrowprops={'arrowstyle': '->', "color" : overtext_color}) + plt.annotate('', xy=(0.87, 0.2), xycoords='axes fraction', xytext=(0.87, 0.095), + arrowprops={'arrowstyle': '->', "color" : overtext_color}) + plt.annotate(self._ax_title[ax_h], xy=(0.87, 0.2), xytext=(0.89, 0.05), + color=overtext_color, xycoords='axes fraction') + plt.annotate(self._ax_title[ax_v], xy=(0.87, 0.2), xytext=(0.83, 0.12), + color=overtext_color, xycoords='axes fraction') if axes: if xlabel is None: xlabel = self._ax_title[ax_h] @@ -736,9 +751,9 @@ class Plotter(Aggregator, BaseProcessor): cbar = plt.colorbar(cax=cbaxes, orientation="vertical") cbaxes.yaxis.set_ticks_position("left") cbaxes.yaxis.set_label_position("left") - cbaxes.yaxis.set_tick_params(color="white", which="both") - plt.setp(plt.getp(cbaxes.axes, "yticklabels"), color="white") - cbar.outline.set_edgecolor("white") + cbaxes.yaxis.set_tick_params(color=overtext_color, which="both") + plt.setp(plt.getp(cbaxes.axes, "yticklabels"), color=overtext_color) + cbar.outline.set_edgecolor(overtext_color) cbaxes.tick_params(axis="y", direction="in", pad=-25) plt.sca(ax) else: @@ -748,14 +763,14 @@ class Plotter(Aggregator, BaseProcessor): cbar = plt.colorbar() if label is not None: if embeded: - cbar.set_label(" " + label, color="white", loc="bottom") + cbar.set_label(" " + label, color=overtext_color, loc="bottom") else: cbar.set_label(label) if put_title: title = self.snapshot_title(run, title, nml_key, put_time, unit_time) if embeded: - ax.text(x=0.05, y=0.95, s=title, color="white", transform=ax.transAxes) + ax.text(x=0.05, y=0.95, s=title, color=overtext_color, transform=ax.transAxes) else: plt.title(title)