smpl.plot.plot_kwargs

smpl.plot.plot_kwargs(kwargs)[source]

Set default plot_kwargs() if not set.

plot_kwargs

default

description

title

None

Plot title

xlabel

X axis label

ylabel

Y axis label

label

None

Legend name of plotted data

fmt

.

Format for plotting fit function

units

None

Units of the fit parameters as strings. Displayed in the Legend

save

None

File to save the plot

lpos

0

Legend position

tight

True

tight_layout

prange

None

Limit the plot of the fit to given range

sigmas

0

Color the array of given sigma times uncertainty. Only works if the fit function is coded with unp

data_sigmas

1

Color the array of given sigma times uncertainty. Only works if the data has uncertainties

init

False

Initialize a new plot

ss

True

save, add legends and grid to the plot

also_data

True

also plot the data

also_fit

True

also plot the fit

auto_fit

False

automatically fit

logy

False

logarithmic x axis

logx

False

logarithmic y axis

function_color

None

Color of the function plot

data_color

None

Color of the data plot

fit_color

None

Color of the fit plot

fit_fmt

Format of the fit plot

residue

False

Display difference between fit and data in a second plot

residue_err

True

Differences between fit and data will have errorbars

show

False

Call plt.show()

size

None

Size of the plot as a tuple (x,y). Only has an effect if init is True

number_format

{0:.4g}

Format to display numbers.

interpolate

False

Enable interpolation of the data.

interpolate_fmt

Either format string or linestyle tuple.

interpolate_label

None

Label for the interpolation.

extrapolate

True

Enable extrapolation of whole data if fit range is limited by frange or fselector.

extrapolate_min

None

Lower extrapolation bound

extrapolate_max

None

Higher extrapolation bound

extrapolate_fmt

Format of the extrapolation line

extrapolate_hatch

||

Extrapolation shape/hatch for filled area in case of sigmas>0. See https://matplotlib.org/stable/gallery/shapes_and_collections/hatch_style_reference.html

bbox_to_anchor

None

Position in a tuple (x,y),Shift position of the legend out of the main pane.

ncol

None

Columns in the legend if used with bbox_to_anchor.

steps

1000

resolution of the plotted function

fitinline

False

No newlines for each fit parameter

grid

True

Enable grid for the plot

hist

False

Enable histogram plot

stairs

False

Enable stair plot

capsize

5

size of cap on error bar plot

axes

None

set current axis

linestyle

None

linestyle, only active if `fmt`=None

xspace

linspace

xspace gets called with xspace(xmin,xmax,steps) in function() to get the points of the function that will be drawn.

alpha

0.2

alpha value for the fill_between plot

Set default fit_kwargs() if not set.

fit_kwargs

default

description

params

None

Initial fit parameters

fixed_params

True

Enable fixing parameters by choosing the same-named variables from kwargs.

maxfev

10000

Maximum function evaluations during fitting.

epsfcn

0.0001

Suitable step length for jacobian approximation.

xvar

None

Variable in fit function parameters that corresponds to the x axis. If it is None the last of the alphabetical sorted parameters is used.

autotqdm

True

Auto fitting display tqdm

fitter

Fitter.AUTO

Choose from :class:`Fitter`s.

Set default data_kwargs() if not set.

data_kwargs

default

description

frange

None

Limit the fit to given range. First integer is the lowest and second the highest index.

fselector

None

Function that takes x and y as parameters and returns an array mask in order to limit the data points for fitting. Alternatively a mask for selecting elements from datax and datay.

sortbyx

True

Enable sorting the x and y data so that x is sorted.

bins

0

Number of bins for histogram

binunc

poisson_dist

Number of bins for histogram

xerror

True

enable xerrors

yerror

True

enable yerrors