get_data_plot_prefs
- sherpa.astro.ui.get_data_plot_prefs(id: IdType | None = None)
Return the preferences for plot_data.
The plot preferences may depend on the data set, so it is now an optional argument.
Changed in version 4.12.2: The id argument has been given.
- Parameters:
id (int, str, or None, optional) – The data set that provides the data. If not given then the default identifier is used, as returned by
get_default_id
.- Returns:
prefs – Changing the values of this dictionary will change any new data plots. This dictionary will be empty if no plot backend is available.
- Return type:
See also
get_plot_prefs
,plot_data
,set_xlinear
,set_xlog
,set_ylinear
,set_ylog
Notes
The meaning of the fields depend on the chosen plot backend. A value of
None
means to use the default value for that attribute, unless indicated otherwise. These preferences are used by the following commands:plot_data
,plot_bkg
,plot_ratio
, and the “fit” variants, such asplot_fit
,plot_fit_resid
, andplot_bkg_fit
.The following preferences are recognized by the matplotlib backend:
alpha
The transparency value used to draw the line or symbol, where 0 is fully transparent and 1 is fully opaque.
barsabove
The barsabove argument for the matplotlib errorbar function.
capsize
The capsize argument for the matplotlib errorbar function.
color
The color to use (will be over-ridden by more-specific options below). The default is
None
.ecolor
The color to draw error bars. The default is
None
.linestyle
How should the line connecting the data points be drawn. The default is ‘None’, which means no line is drawn.
marker
What style is used for the symbols. The default is
'.'
which indicates a point.markerfacecolor
What color to draw the symbol representing the data points. The default is
None
.markersize
What size is the symbol drawn. The default is
None
.xerrorbars
Should error bars be drawn for the X axis. The default is
False
.xlog
Should the X axis be drawn with a logarithmic scale? The default is
False
. This field can also be changed with theset_xlog
andset_xlinear
functions.yerrorbars
Should error bars be drawn for the Y axis. The default is
True
.ylog
Should the Y axis be drawn with a logarithmic scale? The default is
False
. This field can also be changed with theset_ylog
andset_ylinear
functions.
Examples
After these commands, any data plot will use a green symbol and not display Y error bars.
>>> prefs = get_data_plot_prefs() >>> prefs['color'] = 'green' >>> prefs['yerrorbars'] = False