diff --git a/autogalaxy/plot/__init__.py b/autogalaxy/plot/__init__.py index 4b321fd4..dc5e1a00 100644 --- a/autogalaxy/plot/__init__.py +++ b/autogalaxy/plot/__init__.py @@ -10,6 +10,7 @@ from autoarray.dataset.plot.imaging_plots import ( subplot_imaging_dataset, + subplot_imaging_dataset_intro, subplot_imaging_dataset_list, fits_imaging, ) diff --git a/autogalaxy/util/plot_utils.py b/autogalaxy/util/plot_utils.py index e0e5c7c9..0ab06dd1 100644 --- a/autogalaxy/util/plot_utils.py +++ b/autogalaxy/util/plot_utils.py @@ -199,6 +199,7 @@ def plot_array( cb_unit=None, ax=None, arcsec_after_decimal=None, + stretch=None, ): """Plot an autoarray ``Array2D`` to file or onto an existing ``Axes``. @@ -223,6 +224,9 @@ def plot_array( colormap : str Matplotlib colormap name, or ``"default"`` to use the autoarray default (``"jet"``). + stretch : float or None + Positive asinh linear-width fraction of the colour range. Smaller + values reveal fainter structure. Incompatible with ``use_log10=True``. use_log10 : bool If ``True`` apply a log₁₀ stretch to the array values. vmin, vmax : float or None @@ -287,6 +291,7 @@ def plot_array( use_log10=use_log10, vmin=vmin, vmax=vmax, + stretch=stretch, cb_unit=cb_unit, arcsec_after_decimal=arcsec_after_decimal, output_path=_output_path, diff --git a/test_autogalaxy/plot/test_intro_plot.py b/test_autogalaxy/plot/test_intro_plot.py new file mode 100644 index 00000000..111dc411 --- /dev/null +++ b/test_autogalaxy/plot/test_intro_plot.py @@ -0,0 +1,15 @@ +"""The public Galaxy plotting API forwards stretch and exposes the compositor.""" +import numpy as np +import matplotlib.pyplot as plt +from matplotlib.colors import AsinhNorm +import autogalaxy.plot as aplt +import autoarray as aa +from autoarray.dataset.plot.imaging_plots import subplot_imaging_dataset_intro + + +def test_intro_export_and_stretch_forwarding(): + assert aplt.subplot_imaging_dataset_intro is subplot_imaging_dataset_intro + fig, ax = plt.subplots() + aplt.plot_array(aa.Array2D.no_mask(np.eye(3), pixel_scales=.1), ax=ax, stretch=.01) + assert isinstance(ax.images[0].norm, AsinhNorm) + plt.close(fig)