diff --git a/autolens/imaging/plot/fit_imaging_plots.py b/autolens/imaging/plot/fit_imaging_plots.py index fdd4b850d..8bf23565b 100644 --- a/autolens/imaging/plot/fit_imaging_plots.py +++ b/autolens/imaging/plot/fit_imaging_plots.py @@ -8,7 +8,7 @@ from autogalaxy.plot.plot_utils import plot_array from autoarray.plot.array import _zoom_array_2d -from autoarray.plot.utils import save_figure, hide_unused_axes, conf_subplot_figsize +from autoarray.plot.utils import save_figure, hide_unused_axes, conf_subplot_figsize, tight_layout from autoarray.plot.utils import numpy_lines as _to_lines from autoarray.inversion.mappers.abstract import Mapper from autoarray.inversion.plot.mapper_plots import plot_mapper @@ -320,7 +320,7 @@ def subplot_fit( vmax=source_vmax) hide_unused_axes(axes_flat) - plt.tight_layout() + tight_layout() save_figure(fig, path=output_path, filename=f"fit{plane_index_tag}", format=output_format) @@ -384,7 +384,7 @@ def subplot_fit_x1_plane( plot_array(array=norm_resid, ax=axes_flat[5], title="Normalized Residual Map", colormap=colormap, vmin=-_abs_max, vmax=_abs_max, cb_unit=r"$\sigma$") - plt.tight_layout() + tight_layout() save_figure(fig, path=output_path, filename="fit_x1_plane", format=output_format) @@ -508,7 +508,7 @@ def subplot_fit_log10( lines=source_plane_lines, line_colors=source_plane_line_colors, vmax=source_vmax) - plt.tight_layout() + tight_layout() save_figure(fig, path=output_path, filename=f"fit_log10{plane_index_tag}", format=output_format) @@ -569,7 +569,7 @@ def subplot_fit_log10_x1_plane( plot_array(array=fit.chi_squared_map, ax=axes_flat[5], title="Chi-Squared Map", colormap=colormap, use_log10=True, cb_unit=r"$\chi^2$") - plt.tight_layout() + tight_layout() save_figure(fig, path=output_path, filename="fit_log10", format=output_format) @@ -637,7 +637,7 @@ def subplot_of_planes( _plot_source_plane(fit, axes_flat[3], pidx, colormap=colormap) - plt.tight_layout() + tight_layout() save_figure(fig, path=output_path, filename=f"fit_of_plane_{pidx}", format=output_format) @@ -762,7 +762,7 @@ def subplot_tracer_from_fit( plot_array(array=magnification, ax=axes_flat[8], title="Magnification", colormap=colormap) - plt.tight_layout() + tight_layout() save_figure(fig, path=output_path, filename="tracer", format=output_format) @@ -844,7 +844,7 @@ def subplot_fit_combined( plot_array(array=fit.normalized_residual_map, ax=row_axes[5], title="Normalized Residual Map", colormap=colormap, cb_unit=r"$\sigma$") - plt.tight_layout() + tight_layout() save_figure(fig, path=output_path, filename="fit_combined", format=output_format) @@ -920,7 +920,7 @@ def subplot_fit_combined_log10( plot_array(array=fit.normalized_residual_map, ax=row_axes[5], title="Normalized Residual Map", colormap=colormap, cb_unit=r"$\sigma$") - plt.tight_layout() + tight_layout() save_figure(fig, path=output_path, filename="fit_combined_log10", format=output_format) diff --git a/autolens/interferometer/plot/fit_interferometer_plots.py b/autolens/interferometer/plot/fit_interferometer_plots.py index 7dc9ea37d..c853ce7c1 100644 --- a/autolens/interferometer/plot/fit_interferometer_plots.py +++ b/autolens/interferometer/plot/fit_interferometer_plots.py @@ -8,7 +8,7 @@ from autogalaxy.plot.plot_utils import plot_array from autoarray.plot.yx import plot_yx -from autoarray.plot.utils import save_figure, conf_subplot_figsize +from autoarray.plot.utils import save_figure, conf_subplot_figsize, tight_layout from autoarray.plot.utils import numpy_lines as _to_lines from autoarray.inversion.mappers.abstract import Mapper from autoarray.inversion.plot.mapper_plots import plot_mapper @@ -264,7 +264,7 @@ def subplot_fit( lines=source_plane_lines, line_colors=source_plane_line_colors) - plt.tight_layout() + tight_layout() save_figure(fig, path=output_path, filename="fit", format=output_format) @@ -321,7 +321,7 @@ def subplot_fit_dirty_images( plot_array(array=fit.dirty_chi_squared_map, ax=axes_flat[5], title="Dirty Chi-Squared Map", colormap=colormap, cb_unit=r"$\chi^2$") - plt.tight_layout() + tight_layout() save_figure(fig, path=output_path, filename="fit_dirty_images", format=output_format) @@ -383,7 +383,7 @@ def subplot_fit_real_space( title="Source Reconstruction", lines=source_plane_lines, line_colors=source_plane_line_colors) - plt.tight_layout() + tight_layout() save_figure(fig, path=output_path, filename="fit_real_space", format=output_format) @@ -513,5 +513,5 @@ def subplot_tracer_from_fit( plot_array(array=magnification, ax=axes_flat[8], title="Magnification", colormap=colormap) - plt.tight_layout() + tight_layout() save_figure(fig, path=output_path, filename="tracer", format=output_format) diff --git a/autolens/lens/plot/sensitivity_plots.py b/autolens/lens/plot/sensitivity_plots.py index a6b6bf803..748d7117f 100644 --- a/autolens/lens/plot/sensitivity_plots.py +++ b/autolens/lens/plot/sensitivity_plots.py @@ -6,7 +6,7 @@ import autoarray as aa from autogalaxy.plot.plot_utils import plot_array -from autoarray.plot.utils import save_figure +from autoarray.plot.utils import save_figure, tight_layout def subplot_tracer_images( @@ -111,7 +111,7 @@ def subplot_tracer_images( title="Residual Map (Subhalo - No Subhalo)", colormap=colormap, use_log10=use_log10, lines=no_perturb_cc_lines) - plt.tight_layout() + tight_layout() save_figure(fig, path=output_path, filename="lensed_images", format=output_format) @@ -240,7 +240,7 @@ def subplot_sensitivity( except (TypeError, AttributeError): pass - plt.tight_layout() + tight_layout() save_figure(fig, path=output_path, filename="sensitivity", format=output_format) @@ -288,5 +288,5 @@ def subplot_figures_of_merit_grid( fig, ax = plt.subplots(1, 1, figsize=(7, 7)) plot_array(array=figures_of_merit, ax=ax, title="Increase in Log Evidence", colormap=colormap) - plt.tight_layout() + tight_layout() save_figure(fig, path=output_path, filename="sensitivity", format=output_format) diff --git a/autolens/lens/plot/subhalo_plots.py b/autolens/lens/plot/subhalo_plots.py index de979ac82..91a098ab0 100644 --- a/autolens/lens/plot/subhalo_plots.py +++ b/autolens/lens/plot/subhalo_plots.py @@ -3,7 +3,7 @@ from typing import Optional from autogalaxy.plot.plot_utils import plot_array -from autoarray.plot.utils import save_figure +from autoarray.plot.utils import save_figure, tight_layout from autolens.imaging.plot.fit_imaging_plots import _plot_source_plane @@ -94,7 +94,7 @@ def subplot_detection_imaging( colormap=colormap, ) - plt.tight_layout() + tight_layout() save_figure(fig, path=output_path, filename="detection_imaging", format=output_format) @@ -173,5 +173,5 @@ def subplot_detection_fits( _plot_source_plane(fit_imaging_with_subhalo, axes[1][2], plane_index=1, colormap=colormap) - plt.tight_layout() + tight_layout() save_figure(fig, path=output_path, filename="detection_fits", format=output_format) diff --git a/autolens/lens/plot/tracer_plots.py b/autolens/lens/plot/tracer_plots.py index 758757c38..e0d6a1c41 100644 --- a/autolens/lens/plot/tracer_plots.py +++ b/autolens/lens/plot/tracer_plots.py @@ -6,7 +6,7 @@ import autogalaxy as ag from autogalaxy.plot.plot_utils import plot_array -from autoarray.plot.utils import save_figure, hide_unused_axes, conf_subplot_figsize +from autoarray.plot.utils import save_figure, hide_unused_axes, conf_subplot_figsize, tight_layout from autoarray.plot.utils import numpy_positions as _to_positions @@ -187,7 +187,7 @@ def subplot_tracer( lines=image_plane_lines, line_colors=image_plane_line_colors, colormap=colormap) hide_unused_axes(axes_flat) - plt.tight_layout() + tight_layout() save_figure(fig, path=output_path, filename="tracer", format=output_format) @@ -241,7 +241,7 @@ def subplot_lensed_images( use_log10=use_log10, ) - plt.tight_layout() + tight_layout() save_figure(fig, path=output_path, filename="lensed_images", format=output_format) @@ -328,7 +328,7 @@ def subplot_galaxies_images( ) idx += 1 - plt.tight_layout() + tight_layout() save_figure(fig, path=output_path, filename="galaxies_images", format=output_format) diff --git a/autolens/point/plot/fit_point_plots.py b/autolens/point/plot/fit_point_plots.py index 2d50ceff6..cb3380aef 100644 --- a/autolens/point/plot/fit_point_plots.py +++ b/autolens/point/plot/fit_point_plots.py @@ -2,7 +2,7 @@ import numpy as np from typing import Optional -from autoarray.plot.utils import save_figure, conf_subplot_figsize +from autoarray.plot.utils import save_figure, conf_subplot_figsize, tight_layout def subplot_fit( @@ -81,5 +81,5 @@ def subplot_fit( output_format=output_format, ) - plt.tight_layout() + tight_layout() save_figure(fig, path=output_path, filename="fit", format=output_format) diff --git a/autolens/point/plot/point_dataset_plots.py b/autolens/point/plot/point_dataset_plots.py index 662b25143..6cd60762d 100644 --- a/autolens/point/plot/point_dataset_plots.py +++ b/autolens/point/plot/point_dataset_plots.py @@ -2,7 +2,7 @@ import numpy as np from typing import Optional -from autoarray.plot.utils import save_figure, conf_subplot_figsize +from autoarray.plot.utils import save_figure, conf_subplot_figsize, tight_layout def subplot_dataset( @@ -69,5 +69,5 @@ def subplot_dataset( output_format=output_format, ) - plt.tight_layout() + tight_layout() save_figure(fig, path=output_path, filename="dataset_point", format=output_format)