diff --git a/autoarray/dataset/plot/imaging_plotters.py b/autoarray/dataset/plot/imaging_plotters.py index 22da088c..d89c9163 100644 --- a/autoarray/dataset/plot/imaging_plotters.py +++ b/autoarray/dataset/plot/imaging_plotters.py @@ -1,3 +1,4 @@ +import copy from typing import Callable, Optional from autoarray.plot.visuals.two_d import Visuals2D @@ -161,9 +162,13 @@ def subplot_dataset(self): self.figures_2d(data=True) + contour_original = copy.copy(self.mat_plot_2d.contour) + self.mat_plot_2d.use_log10 = True + self.mat_plot_2d.contour = False self.figures_2d(data=True) self.mat_plot_2d.use_log10 = False + self.mat_plot_2d.contour = contour_original self.figures_2d(noise_map=True) @@ -175,13 +180,12 @@ def subplot_dataset(self): self.figures_2d(signal_to_noise_map=True) - self.mat_plot_2d.output.subplot_to_figure( - auto_filename="subplot_dataset" - ) + self.mat_plot_2d.output.subplot_to_figure(auto_filename="subplot_dataset") self.close_subplot_figure() self.mat_plot_2d.use_log10 = use_log10_original + class ImagingPlotter(Plotter): def __init__( self, diff --git a/autoarray/plot/mat_plot/two_d.py b/autoarray/plot/mat_plot/two_d.py index 25894f52..fae9f645 100644 --- a/autoarray/plot/mat_plot/two_d.py +++ b/autoarray/plot/mat_plot/two_d.py @@ -352,7 +352,8 @@ def plot_array( ) self.colorbar_tickparams.set(cb=cb) - self.contour.set(array=array, extent=extent, use_log10=self.use_log10) + if self.contour is not False: + self.contour.set(array=array, extent=extent, use_log10=self.use_log10) grid_indexes = None @@ -452,7 +453,8 @@ def plot_grid( self.yticks.set(min_value=extent[2], max_value=extent[3], units=self.units) self.xticks.set(min_value=extent[0], max_value=extent[1], units=self.units) - self.contour.set(array=color_array, extent=extent, use_log10=self.use_log10) + if self.contour is not False: + self.contour.set(array=color_array, extent=extent, use_log10=self.use_log10) visuals_2d.plot_via_plotter(plotter=self, grid_indexes=grid) diff --git a/autoarray/plot/wrap/base/abstract.py b/autoarray/plot/wrap/base/abstract.py index 3c5858a9..6146d1bc 100644 --- a/autoarray/plot/wrap/base/abstract.py +++ b/autoarray/plot/wrap/base/abstract.py @@ -113,4 +113,4 @@ def config_category(self): @property def log10_min_value(self): - return conf.instance["visualize"]["general"]["general"]["log10_min_value"] \ No newline at end of file + return conf.instance["visualize"]["general"]["general"]["log10_min_value"] diff --git a/autoarray/plot/wrap/base/colorbar.py b/autoarray/plot/wrap/base/colorbar.py index 88a240e9..e52f67d9 100644 --- a/autoarray/plot/wrap/base/colorbar.py +++ b/autoarray/plot/wrap/base/colorbar.py @@ -80,7 +80,6 @@ def tick_values_from(self, norm=None, use_log10: bool = False): max_value = norm.vmax if use_log10: - if min_value < self.log10_min_value: min_value = self.log10_min_value diff --git a/autoarray/plot/wrap/two_d/contour.py b/autoarray/plot/wrap/two_d/contour.py index d03b66b6..c8015981 100644 --- a/autoarray/plot/wrap/two_d/contour.py +++ b/autoarray/plot/wrap/two_d/contour.py @@ -56,8 +56,12 @@ def levels_from( """ if self.manual_levels is None: if self.use_log10: + min_value = np.min(array) + if min_value < self.log10_min_value: + min_value = self.log10_min_value + return np.logspace( - np.log10(np.min(array)), + np.log10(min_value), np.log10(np.max(array)), self.total_contours, )