autolens.plot.MatPlot1D

class autolens.plot.MatPlot1D(units: autoarray.plot.wrap.wrap_base.Units = <autoarray.plot.wrap.wrap_base.Units object>, figure: autoarray.plot.wrap.wrap_base.Figure = <autoarray.plot.wrap.wrap_base.Figure object>, axis: autoarray.plot.wrap.wrap_base.Axis = <autoarray.plot.wrap.wrap_base.Axis object>, cmap: autoarray.plot.wrap.wrap_base.Cmap = <autoarray.plot.wrap.wrap_base.Cmap object>, colorbar: autoarray.plot.wrap.wrap_base.Colorbar = <autoarray.plot.wrap.wrap_base.Colorbar object>, colorbar_tickparams: autoarray.plot.wrap.wrap_base.ColorbarTickParams = <autoarray.plot.wrap.wrap_base.ColorbarTickParams object>, tickparams: autoarray.plot.wrap.wrap_base.TickParams = <autoarray.plot.wrap.wrap_base.TickParams object>, yticks: autoarray.plot.wrap.wrap_base.YTicks = <autoarray.plot.wrap.wrap_base.YTicks object>, xticks: autoarray.plot.wrap.wrap_base.XTicks = <autoarray.plot.wrap.wrap_base.XTicks object>, title: autoarray.plot.wrap.wrap_base.Title = <autoarray.plot.wrap.wrap_base.Title object>, ylabel: autoarray.plot.wrap.wrap_base.YLabel = <autoarray.plot.wrap.wrap_base.YLabel object>, xlabel: autoarray.plot.wrap.wrap_base.XLabel = <autoarray.plot.wrap.wrap_base.XLabel object>, text: autoarray.plot.wrap.wrap_base.Text = <autoarray.plot.wrap.wrap_base.Text object>, legend: autoarray.plot.wrap.wrap_base.Legend = <autoarray.plot.wrap.wrap_base.Legend object>, output: autoarray.plot.wrap.wrap_base.Output = <autoarray.plot.wrap.wrap_base.Output object>, yx_plot: autoarray.plot.wrap.wrap_1d.YXPlot = <autoarray.plot.wrap.wrap_1d.YXPlot object>, half_light_radius_axvline: autogalaxy.plot.mat_wrap.lensing_wrap.HalfLightRadiusAXVLine = <autogalaxy.plot.mat_wrap.lensing_wrap.HalfLightRadiusAXVLine object>, einstein_radius_axvline: autogalaxy.plot.mat_wrap.lensing_wrap.EinsteinRadiusAXVLine = <autogalaxy.plot.mat_wrap.lensing_wrap.EinsteinRadiusAXVLine object>, model_fluxes_yx_scatter: autogalaxy.plot.mat_wrap.lensing_wrap.ModelFluxesYXScatter = <autogalaxy.plot.mat_wrap.lensing_wrap.ModelFluxesYXScatter object>, fill_between: autoarray.plot.wrap.wrap_1d.FillBetween = <autoarray.plot.wrap.wrap_1d.FillBetween object>)
__init__(units: autoarray.plot.wrap.wrap_base.Units = <autoarray.plot.wrap.wrap_base.Units object>, figure: autoarray.plot.wrap.wrap_base.Figure = <autoarray.plot.wrap.wrap_base.Figure object>, axis: autoarray.plot.wrap.wrap_base.Axis = <autoarray.plot.wrap.wrap_base.Axis object>, cmap: autoarray.plot.wrap.wrap_base.Cmap = <autoarray.plot.wrap.wrap_base.Cmap object>, colorbar: autoarray.plot.wrap.wrap_base.Colorbar = <autoarray.plot.wrap.wrap_base.Colorbar object>, colorbar_tickparams: autoarray.plot.wrap.wrap_base.ColorbarTickParams = <autoarray.plot.wrap.wrap_base.ColorbarTickParams object>, tickparams: autoarray.plot.wrap.wrap_base.TickParams = <autoarray.plot.wrap.wrap_base.TickParams object>, yticks: autoarray.plot.wrap.wrap_base.YTicks = <autoarray.plot.wrap.wrap_base.YTicks object>, xticks: autoarray.plot.wrap.wrap_base.XTicks = <autoarray.plot.wrap.wrap_base.XTicks object>, title: autoarray.plot.wrap.wrap_base.Title = <autoarray.plot.wrap.wrap_base.Title object>, ylabel: autoarray.plot.wrap.wrap_base.YLabel = <autoarray.plot.wrap.wrap_base.YLabel object>, xlabel: autoarray.plot.wrap.wrap_base.XLabel = <autoarray.plot.wrap.wrap_base.XLabel object>, text: autoarray.plot.wrap.wrap_base.Text = <autoarray.plot.wrap.wrap_base.Text object>, legend: autoarray.plot.wrap.wrap_base.Legend = <autoarray.plot.wrap.wrap_base.Legend object>, output: autoarray.plot.wrap.wrap_base.Output = <autoarray.plot.wrap.wrap_base.Output object>, yx_plot: autoarray.plot.wrap.wrap_1d.YXPlot = <autoarray.plot.wrap.wrap_1d.YXPlot object>, half_light_radius_axvline: autogalaxy.plot.mat_wrap.lensing_wrap.HalfLightRadiusAXVLine = <autogalaxy.plot.mat_wrap.lensing_wrap.HalfLightRadiusAXVLine object>, einstein_radius_axvline: autogalaxy.plot.mat_wrap.lensing_wrap.EinsteinRadiusAXVLine = <autogalaxy.plot.mat_wrap.lensing_wrap.EinsteinRadiusAXVLine object>, model_fluxes_yx_scatter: autogalaxy.plot.mat_wrap.lensing_wrap.ModelFluxesYXScatter = <autogalaxy.plot.mat_wrap.lensing_wrap.ModelFluxesYXScatter object>, fill_between: autoarray.plot.wrap.wrap_1d.FillBetween = <autoarray.plot.wrap.wrap_1d.FillBetween object>)

Visualizes 1D data structures as a y versus x plot using Matplotlib.

The Plotter is passed objects from the wrap_base package which wrap matplotlib plot functions and customize the appearance of the plots of the data structure. If the values of these matplotlib wrapper objects are not manually specified, they assume the default values provided in the config.visualize.mat_* .ini config files.

Parameters:
  • units (aplt.Units) – The units of the figure used to plot the data structure which sets the y and x ticks and labels.
  • figure (aplt.Figure) – Opens the matplotlib figure before plotting via plt.figure and closes it once plotting is complete via plt.close.
  • axis (aplt.Axis) – Sets the extent of the figure axis via plt.axis and allows for a manual axis range.
  • cmap (aplt.Cmap) – Customizes the colormap of the plot and its normalization via matplotlib colors objects such as colors.Normalize and colors.LogNorm.
  • colorbar (aplt.Colorbar) – Plots the colorbar of the plot via plt.colorbar and customizes its tick labels and values using method like cb.set_yticklabels.
  • colorbar_tickparams (aplt.ColorbarTickParams) – Customizes the yticks of the colorbar plotted via plt.colorbar.
  • tickparams (aplt.TickParams) – Customizes the appearances of the y and x ticks on the plot, (e.g. the fontsize), using plt.tick_params.
  • yticks (aplt.YTicks) – Sets the yticks of the plot, including scaling them to new units depending on the Units object, via plt.yticks.
  • xticks (aplt.XTicks) – Sets the xticks of the plot, including scaling them to new units depending on the Units object, via plt.xticks.
  • title (aplt.Title) – Sets the figure title and customizes its appearance using plt.title.
  • ylabel (aplt.YLabel) – Sets the figure ylabel and customizes its appearance using plt.ylabel.
  • xlabel (aplt.XLabel) – Sets the figure xlabel and customizes its appearance using plt.xlabel.
  • legend (aplt.Legend) – Sets whether the plot inclues a legend and customizes its appearance and labels using plt.legend.
  • output (aplt.Output) – Sets if the figure is displayed on the user’s screen or output to .png using plt.show and plt.savefig
  • yx_plot (aplt.YXPlot) – Sets how the y versus x plot appears, for example if it each axis is linear or log, using plt.plot.
  • half_light_radius_axvline (lw.HalfLightRadiusAXVLine) – Sets how a vertical line representing the half light radius of a LightProfile is plotted on the figure using the plt.axvline method.
  • half_light_radius_axvline – Sets how a vertical line representing the Einstein radius of a LensingObj (e.g. a MassProfile) is plotted on the figure using the plt.axvline method.

Methods

__init__(units, figure, axis, cmap, …) Visualizes 1D data structures as a y versus x plot using Matplotlib.
get_subplot_rows_columns(number_subplots) Get the size of a sub plotter in (total_y_pixels, total_x_pixels), based on the number of subplots that are going to be plotted.
plot_yx(y, List[T], …[, y_errors, x_errors])
set_for_multi_plot(is_for_multi_plot, color) Sets the is_for_subplot attribute for every MatWrap object in this MatPlot object by updating the is_for_subplot.
set_for_subplot(is_for_subplot) Sets the is_for_subplot attribute for every MatWrap object in this MatPlot object by updating the is_for_subplot.
setup_subplot([aspect, subplot_rows_columns])
set_for_multi_plot(is_for_multi_plot: bool, color: str)

Sets the is_for_subplot attribute for every MatWrap object in this MatPlot object by updating the is_for_subplot. By changing this tag:

  • The [subplot] section of the config file of every MatWrap object is used instead of [figure].
  • Calls which output or close the matplotlib figure are over-ridden so that the subplot is not removed.
Parameters:is_for_subplot (bool) – The entry the is_for_subplot attribute of every MatWrap object is set too.