Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions autogalaxy/plot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

from autoarray.dataset.plot.imaging_plots import (
subplot_imaging_dataset,
subplot_imaging_dataset_intro,
subplot_imaging_dataset_list,
fits_imaging,
)
Expand Down
5 changes: 5 additions & 0 deletions autogalaxy/util/plot_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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``.

Expand All @@ -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
Expand Down Expand Up @@ -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,
Expand Down
15 changes: 15 additions & 0 deletions test_autogalaxy/plot/test_intro_plot.py
Original file line number Diff line number Diff line change
@@ -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)
Loading