spectrochempy.plotο
- plot(self, method=None, **kwargs)[source]ο
Plot the dataset using the specified method.
- Parameters:
dataset (
NDDataset
) β Source of data to plot.method (str, optional, default:
preference.method_1D
orpreference.method_2D
) β Name of plotting method to use. If None, method is chosen based on data dimensionality.1D plotting methods:
pen
: Solid line plotbar
: Bar graphscatter
: Scatter plotscatter+pen
: Scatter plot with solid line
2D plotting methods:
**kwargs (keyword parameters, optional) β See Other Parameters.
- Other Parameters:
ax (Axe, optional) β Axe where to plot. If not specified, create a new one.
clear (bool, optional, default: True) β If false, hold the current figure and ax until a new plot is performed.
color or c (color, optional, default: auto) β color of the line.
colorbar (bool, optional, default: True) β Show colorbar (2D plots only).
commands (str,) β matplotlib commands to be executed.
data_only (bool, optional, default: False) β Only the plot is done. No addition of axes or label specifications.
dpi (int, optional) β the number of pixel per inches.
figsize (tuple, optional, default is (3.4, 1.7)) β figure size.
fontsize (int, optional) β The font size in pixels, default is 10 (or read from preferences).
imag (bool, optional, default: False) β Show imaginary component for complex data. By default the real component is displayed.
linestyle or ls (str, optional, default: auto) β line style definition.
linewidth or lw (float, optional, default: auto) β line width.
marker, m (str, optional, default: auto) β marker type for scatter plot. If marker != ββ then the scatter type of plot is chosen automatically.
markeredgecolor or mec (color, optional)
markeredgewidth or mew (float, optional)
markerfacecolor or mfc (color, optional)
markersize or ms (float, optional)
markevery (None or int)
modellinestyle or modls (str) β line style of the model.
offset (float) β offset of the model individual lines.
output (str,) β name of the file to save the figure.
plot_model (Bool,) β plot model data if available.
plottitle (bool, optional, default: False) β Use the name of the dataset as title. Works only if title is not defined
projections (bool, optional, default: False) β Show projections on the axes (2D plots only).
reverse (bool or None [optional, default=None/False) β In principle, coordinates run from left to right, except for wavenumbers (e.g., FTIR spectra) or ppm (e.g., NMR), that spectrochempy will try to guess. But if reverse is set, then this is the setting which will be taken into account.
show_complex (bool, optional, default: False) β Show both real and imaginary component for complex data. By default only the real component is displayed.
show_mask (bool, optional) β Should we display the mask using colored area.
show_z (bool, optional, default: True) β should we show the vertical axis.
show_zero (bool, optional) β show the zero basis.
style (str, optional, default:
scp.preferences.style
(scpy)) β Matplotlib stylesheet (useavailable_style
to get a list of available styles for plotting.title (str) β Title of the plot (or subplot) axe.
transposed (bool, optional, default: False) β Transpose the data before plotting (2D plots only).
twinx (
Axes
instance, optional, default: None) β If this is not None, then a twin axes will be created with a common x dimension.uselabel_x (bool, optional) β use x coordinate label as x tick labels
vshift (float, optional) β vertically shift the line from its baseline.
xlim (tuple, optional) β limit on the horizontal axis.
xlabel (str, optional) β label on the horizontal axis.
x_reverse (bool, optional, default: False) β reverse the x axis. Equivalent to
reverse
.ylabel or zlabel (str, optional) β label on the vertical axis.
ylim or zlim (tuple, optional) β limit on the vertical axis.
y_reverse (bool, optional, default: False) β reverse the y axis (2D plot only).
- Returns:
Matplolib Axes or None β The matplotlib axes containing the plot if successful, None otherwise.