get_plot_prefs
- sherpa.astro.ui.get_plot_prefs(plottype: str, id: IdType | None = None, **kwargs) PrefsType
Return the preferences for the given plot type.
Added in version 4.16.0.
- Parameters:
- plottype
str The type of plt, such as “data”, “model”, or “resid”. The “fit” argument is not supported.
- id
int,str,orNone,optional The data set that provides the data. If not given then the default identifier is used, as returned by
get_default_id.
- plottype
- Returns:
- prefs
dict Changing the values of this dictionary will change any new data plots. This dictionary will be empty if no plot backend is available.
- prefs
Notes
The “fit” argument can not be used, even though there is a get_fit_plot call. Either use the “data” or “model” arguments to access the desired plot type, or use get_fit_plot() and access the dataplot and modelplot attributes directly.
The meaning of the fields depend on the chosen plot backend. A value of
Nonemeans to use the default value for that attribute, or not to use that setting.The following preferences are recognized by the matplotlib backend:
alphaThe transparency value used to draw the line or symbol, where 0 is fully transparent and 1 is fully opaque.
barsaboveThe barsabove argument for the matplotlib errorbar function.
capsizeThe capsize argument for the matplotlib errorbar function.
colorThe color to use (will be over-ridden by more-specific options below).
ecolorThe color to draw error bars.
linestyleHow should the line connecting the data points be drawn.
markerWhat style is used for the symbols.
markerfacecolorWhat color to draw the symbol representing the data points.
markersizeWhat size is the symbol drawn.
xerrorbarsShould error bars be drawn for the X axis.
xlogShould the X axis be drawn with a logarithmic scale? This field can also be changed with the
set_xlogandset_xlinearfunctions.yerrorbarsShould error bars be drawn for the Y axis.
ylogShould the Y axis be drawn with a logarithmic scale? This field can also be changed with the
set_ylogandset_ylinearfunctions.
Examples
After these commands, any data plot will use a green symbol and not display Y error bars.
>>> prefs = get_plot_prefs("data") >>> prefs['color'] = 'green' >>> prefs['yerrorbars'] = False