Skip to main content

Module commands

Module commands 

Source
Expand description

Commonly used plotting commands.

This module contains types representing many common plotting commands, implementing Matplotlib and sometimes MatplotlibOpts. Each can be instantiated using their constructor methods or using a corresponding function from this module for convenience, e.g.

let p1 = Plot::new([0.0, 1.0, 2.0], [0.0, 2.0, 4.0]);
let p2 =      plot([0.0, 1.0, 2.0], [0.0, 2.0, 4.0]);

assert_eq!(p1, p2);

Note: Several constructors take iterators of flat 3-, 4-, or 6-element tuples. This is inconvenient with respect to Iterator::zip, so this module also provides Associator and assoc to help with rearrangement.

Structs§

Aspect
Set the axis aspect ratio, i.e. y/x-scale.
AxHLine
A horizontal line.
AxLine
A line passing through two points.
AxLineM
A line passing through one point with a slope.
AxText
Some text placed in a plot via axes [0, 1] coordinates.
AxVLine
A vertical line.
Backend
Specify a GUI backend.
Bar
A bar plot.
BarH
A horizontal bar plot.
Boxplot
Box(-and-whisker) plots for a number of data sets.
CLabel
Set a label on a colorbar.
CLim
Set the plotting limits of the colorbar.
CTickLabels
Set the values and labels for which ticks are placed on a colorbar.
CTicks
Set the values for which ticks are placed on a colorbar.
CloseFig
Close a figure.
Colorbar
Add a colorbar to the figure.
Colorplot
A 2D, rectangular data set as an image over non-uniformly spaced coordinates.
Contour
A contour plot for a (x, y, z) surface.
ContourLabels
Turn on labels for the contour in a Contour plot.
Contourf
A filled contour plot for a (x, y, z) surface.
Errorbar
Plot with error bars.
Errorbar2
Plot with asymmetric error bars.
FigText
Some text placed in a figure via figure [0, 1] coordinates.
FillBetween
A filled area between two horizontal curves.
FillBetweenX
A filled area between two vertical curves.
FocusAx
Set the local variable ax to a different set of axes.
FocusCBar
Set the local variable cbar to a different colorbar.
FocusFig
Set the local variable fig to a different figure.
FocusIm
Set the local variable im to a different image or mappable object.
Grid
Activate or modify the coordinate grid.
Hist
A histogram of a data set.
Hist2d
A histogram of two variables.
Imshow
A 2D data set as an image.
Init3D
Initialize to a figure with a single set of 3D axes.
InitGrid
Initialize to a figure with a regular grid of plots.
InitGridSpec
Initialize a figure with Matplotlib’s gridspec.
InsetAxes
Create and refocus to a set of axes inset to ax.
InvertAx
Invert an axis.
Label
Set a label on a set of axes.
Legend
Place a legend on a set of axes.
Lim
Set the plotting limits of an axis.
Pie
A pie chart for a single data set.
Plot
A (x, y) plot.
Plot3
A (x, y, z) plot.
Prelude
Direct injection of arbitrary Python into the prelude.
Quiver
A vector field plot.
Quiver3
A 3D vector field plot.
Raw
Direct injection of arbitrary Python.
RcParam
Set the value of an RC parameter.
Scale
Set the scaling of an axis.
Scatter
A (x, y) scatter plot.
Scatter3
A (x, y, z) scatter plot.
Stairs
A stair-step plot.
Stem
A stem plot.
Step
A step plot.
SupTitle
Set the title of the figure.
SupXLabel
Set the X label of the figure.
SupYLabel
Set the Y label of the figure.
Surface
A 3D surface plot.
TeX
Activate or deactivate TeX text.
Text
Some text placed in a plot via data coordinates.
TickLabels
Set the values and labels for which ticks are placed on an axis.
TickParams
Set the appearance of ticks, tick labels, and gridlines.
Ticks
Set the values for which ticks are placed on an axis.
TightLayout
Adjust the padding between and around subplots.
Title
Set the title of a set of axes.
Trisurf
A 3D surface plot using triangulation.
ViewInit
Set the view on a set of 3D axes.
Violinplot
Violin plots for a number of data sets.

Enums§

Axis
An axis of a Matplotlib Axes or Axes3D object.
Axis2
Like Axis, but limited to X or Y and with the option of both.
AxisScale
An axis scaling.
ColorCell
A single color cell in an image plot.

Traits§

Associator
Rearrange the grouping of tuples.
Real
Helper trait to coerce basic numerical types (and references thereof) to f64s for internal storage in the provided commands.

Functions§

aspect
Create a new Aspect with no options.
assoc
Quick shortcut to Associator::assoc that doesn’t require importing the trait.
assoc_iter
Quick shortcut to calling .map on an iterator with assoc.
axhline
Create a new AxHLine with no options.
axline
Create a new AxLine with no options.
axlinem
Create a new AxLineM with no options.
axtext
Create a new AxText with no options.
axvline
Create a new AxVLine with no options.
backend
Create a new Backend.
bar
Create a new Bar with no options.
bar_pairs
Create a new Bar with options from a single iterator.
barh
Create a new BarH with no options.
barh_pairs
Create a new BarH with options from a single iterator.
boxplot
Create a new Boxplot with no options.
boxplot_flat
Create a new Boxplot from a flattened iterator over a number of data set of size size.
clabel
Create a new CLabel with no options.
clim
Create a new CLim.
close_fig
Create a new CloseFig.
colorbar
Create a new Colorbar with no options.
colorplot
Create a new Colorplot with no options.
colorplot_flat
Create a new Colorplot from a flattened, row-major iterator over image data.
colorplot_flat_c
Create a new Colorplot from a flattened, column-major iterator over image data.
contour
Create a new Contour with no options.
contour_flat
Create a new Contour with no options using a flattened iterator over z-coordinates.
contour_labels
Create a new ContourLabels with no options and no formatter.
contourf
Create a new Contourf with no options.
contourf_flat
Create a new Contourf with no options using a flattened iterator over z-coordinates.
cticklabels
Create a new CTickLabels with no options.
cticklabels_data
Create a new CTickLabels with no options from a single iterator.
cticks
Create a new CTicks with no options.
errorbar
Create a new Errorbar with no options.
errorbar2
Create a new Errorbar2 with no options.
errorbar2_data
Create a new Errorbar2 with no options from a single iterator.
errorbar_data
Create a new Errorbar with no options from a single iterator.
figtext
Create a new FigText with no options.
fill_between
Create a new FillBetween with no options.
fill_between_data
Create a new FillBetween with no options from a single iterator.
fill_betweenx
Create a new FillBetweenX with no options.
fill_betweenx_data
Create a new FillBetweenX with no options from a single iterator.
focus_ax
Create a new FocusAx.
focus_cbar
Create a new FocusCBar.
focus_fig
Create a new FocusFig.
focus_im
Create a new FocusIm.
grid
Create a new Grid with no options.
hist
Create a new Hist with no options.
hist2d
Create a new Hist2d with no options.
hist2d_pairs
Create a new Hist2d with no options from a single iterator.
imshow
Create a new Imshow with no options.
imshow_flat
Create a new Imshow from a flattened, row-major iterator over image data with row length rowlen.
imshow_flat_c
Create a new Imshow from a flattened, column-major iterator over image data with column length collen.
init_grid
Create a new InitGrid with no options.
init_gridspec
Create a new InitGridSpec.
inset_axes
Create a new InsetAxes with no options.
inset_axes_pairs
Create a new InsetAxes with no options from (x, y) and (width, height) pairs.
invert_ax
Create a new InvertAx.
invert_x
Create a new InvertAx for the X-axis.
invert_y
Create a new InvertAx for the Y-axis.
invert_z
Create a new InvertAx for the Z-axis.
label
Create a new Label with no options.
legend
Create a new Legend with no options.
lim
Create a new Lim.
pie
Create a new Pie with no options.
plot
Create a new Plot with no options.
plot3
Create a new Plot3 with no options.
plot3_data
Create a new Plot3 with no options from a single iterator.
plot_pairs
Create a new Plot with no options from a single iterator.
prelude
Create a new Prelude.
quiver
Create a new Quiver with no options.
quiver3
Create a new Quiver3 with no options.
quiver3_data
Create a new Quiver3 with no options from a single iterator.
quiver3_triples
Create a new Quiver3 with no options from iterators over coordinate triples.
quiver_data
Create a new Quiver with no options from a single iterator. The first two elements of each iterator item should be spatial coordinates and the last two should be vector components.
quiver_pairs
Create a new Quiver with no options from iterators over coordinate pairs.
raw
Create a new Raw.
rcparam
Create a new RcParam.
scale
Create a new Scale.
scatter
Create a new Scatter with no options.
scatter3
Create a new Scatter3 with no options.
scatter3_data
Create a new Scatter3 with no options from a single iterator.
scatter_pairs
Create a new Scatter with no options from a single iterator.
stairs
Create a new Stairs with no options.
stairs_pairs
Create a new Stairs with no options from a single iterator.
stem
Create a new Stem with no options.
stem_pairs
Create a new Stem with no options from a single iterator.
step
Create a new Step with no options.
step_pairs
Create a new Step with no options from a single iterator.
suptitle
Create a new SupTitle with no options.
supxlabel
Create a new SupXLabel with no options.
supylabel
Create a new SupYLabel with no options.
surface
Create a new Surface with no options.
surface_data
Create a new Surface from a single flattened, row-major iterator over coordinate data with row length rowlen.
surface_flat
Create a new Surface from flattened, row-major iterators over coordinate data with row length rowlen.
tex_off
Turn TeX text off.
tex_on
Turn TeX text on.
text
Create a new Text with no options.
tick_params
Create a new TickParams with no options.
ticklabels
Create a new TickLabels with no options.
ticklabels_data
Create a new TickLabels with no options from a single iterator.
ticks
Create a new Ticks with no options.
tight_layout
Create a new TightLayout with no options.
title
Create a new Title with no options.
trisurf
Create a new Trisurf with no options.
trisurf_data
Create a new Trisurf with no options from a single iterator.
view_init
Create a new ViewInit with no options.
violinplot
Create a new Violinplot with no options.
violinplot_flat
Create a new Violinplot from a flattened iterator over a number of data set of size size.
xlabel
Create a new Label for the X-axis with no options.
xlim
Create a new Lim for the X-axis.
xscale
Create a new Scale for the X-axis.
xtick_params
Create a new TickParams for the X-axis with no options.
xticklabels
Create a new TickLabels for the X-axis with no options.
xticklabels_data
Create a new TickLabels for the X-axis with no options from a single iterator.
xticks
Create a new Ticks for the X-axis with no options.
ylabel
Create a new Label for the Y-axis with no options.
ylim
Create a new Lim for the Y-axis.
yscale
Create a new Scale for the Y-axis.
ytick_params
Create a new TickParams for the Y-axis with no options.
yticklabels
Create a new TickLabels for the Y-axis with no options.
yticklabels_data
Create a new TickLabels for the Y-axis with no options from a single iterator.
yticks
Create a new Ticks for the Y-axis with no options.
zlabel
Create a new Label for the Z-axis with no options.
zlim
Create a new Lim for the Z-axis.
zscale
Create a new Scale for the Z-axis.
zticklabels
Create a new TickLabels for the Z-axis with no options.
zticklabels_data
Create a new TickLabels for the Z-axis with no options from a single iterator.
zticks
Create a new Ticks for the Z-axis with no options.