autogalaxy.plot.MatPlot1D#

class MatPlot1D[source]#

Bases: MatPlot1D

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 (Optional[Units]) – The units of the figure used to plot the data structure which sets the y and x ticks and labels.

  • figure (Optional[Figure]) – Opens the matplotlib figure before plotting via plt.figure and closes it once plotting is complete via plt.close.

  • axis (Optional[Axis]) – Sets the extent of the figure axis via plt.axis and allows for a manual axis range.

  • cmap (Optional[Cmap]) – Customizes the colormap of the plot and its normalization via matplotlib colors objects such as colors.Normalize and colors.LogNorm.

  • colorbar (Optional[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 (Optional[ColorbarTickParams]) – Customizes the yticks of the colorbar plotted via plt.colorbar.

  • tickparams (Optional[TickParams]) – Customizes the appearances of the y and x ticks on the plot, (e.g. the fontsize), using plt.tick_params.

  • yticks (Optional[YTicks]) – Sets the yticks of the plot, including scaling them to new units depending on the Units object, via plt.yticks.

  • xticks (Optional[XTicks]) – Sets the xticks of the plot, including scaling them to new units depending on the Units object, via plt.xticks.

  • title (Optional[Title]) – Sets the figure title and customizes its appearance using plt.title.

  • ylabel (Optional[YLabel]) – Sets the figure ylabel and customizes its appearance using plt.ylabel.

  • xlabel (Optional[XLabel]) – Sets the figure xlabel and customizes its appearance using plt.xlabel.

  • legend (Optional[Legend]) – Sets whether the plot inclues a legend and customizes its appearance and labels using plt.legend.

  • output (Optional[Output]) – Sets if the figure is displayed on the user’s screen or output to .png using plt.show and plt.savefig

  • yx_plot (Optional[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 (Optional[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

get_subplot_shape

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

set_for_multi_plot

Sets the is_for_subplot attribute for every MatWrap object in this MatPlot object by updating the is_for_subplot.

set_for_subplot

Sets the is_for_subplot attribute for every MatWrap object in this MatPlot object by updating the is_for_subplot.

setup_subplot

Setup a new figure to be plotted on a subplot, which is used by a Plotter when plotting multiple images on a subplot.

set_for_multi_plot(is_for_multi_plot, color, xticks=None, yticks=None)[source]#

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 – The entry the is_for_subplot attribute of every MatWrap object is set too.