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.
- CTick
Labels - 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.
- Close
Fig - 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.
- Contour
Labels - Turn on labels for the contour in a
Contourplot. - 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.
- Fill
Between - A filled area between two horizontal curves.
- Fill
BetweenX - A filled area between two vertical curves.
- FocusAx
- Set the local variable
axto a different set of axes. - FocusC
Bar - Set the local variable
cbarto a different colorbar. - Focus
Fig - Set the local variable
figto a different figure. - FocusIm
- Set the local variable
imto 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.
- Init
Grid - Initialize to a figure with a regular grid of plots.
- Init
Grid Spec - Initialize a figure with Matplotlib’s
gridspec. - Inset
Axes - Create and refocus to a set of axes inset to
ax. - Invert
Ax - 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.
- SupX
Label - Set the X label of the figure.
- SupY
Label - 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.
- Tick
Labels - Set the values and labels for which ticks are placed on an axis.
- Tick
Params - Set the appearance of ticks, tick labels, and gridlines.
- Ticks
- Set the values for which ticks are placed on an axis.
- Tight
Layout - Adjust the padding between and around subplots.
- Title
- Set the title of a set of axes.
- Trisurf
- A 3D surface plot using triangulation.
- View
Init - 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
AxesorAxes3Dobject. - Axis2
- Like
Axis, but limited to X or Y and with the option of both. - Axis
Scale - An axis scaling.
- Color
Cell - 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
Aspectwith no options. - assoc
- Quick shortcut to
Associator::assocthat doesn’t require importing the trait. - assoc_
iter - Quick shortcut to calling
.mapon an iterator withassoc. - axhline
- Create a new
AxHLinewith no options. - axline
- Create a new
AxLinewith no options. - axlinem
- Create a new
AxLineMwith no options. - axtext
- Create a new
AxTextwith no options. - axvline
- Create a new
AxVLinewith no options. - backend
- Create a new
Backend. - bar
- Create a new
Barwith no options. - bar_
pairs - Create a new
Barwith options from a single iterator. - barh
- Create a new
BarHwith no options. - barh_
pairs - Create a new
BarHwith options from a single iterator. - boxplot
- Create a new
Boxplotwith no options. - boxplot_
flat - Create a new
Boxplotfrom a flattened iterator over a number of data set of sizesize. - clabel
- Create a new
CLabelwith no options. - clim
- Create a new
CLim. - close_
fig - Create a new
CloseFig. - colorbar
- Create a new
Colorbarwith no options. - colorplot
- Create a new
Colorplotwith no options. - colorplot_
flat - Create a new
Colorplotfrom a flattened, row-major iterator over image data. - colorplot_
flat_ c - Create a new
Colorplotfrom a flattened, column-major iterator over image data. - contour
- Create a new
Contourwith no options. - contour_
flat - Create a new
Contourwith no options using a flattened iterator over z-coordinates. - contour_
labels - Create a new
ContourLabelswith no options and no formatter. - contourf
- Create a new
Contourfwith no options. - contourf_
flat - Create a new
Contourfwith no options using a flattened iterator over z-coordinates. - cticklabels
- Create a new
CTickLabelswith no options. - cticklabels_
data - Create a new
CTickLabelswith no options from a single iterator. - cticks
- Create a new
CTickswith no options. - errorbar
- Create a new
Errorbarwith no options. - errorbar2
- Create a new
Errorbar2with no options. - errorbar2_
data - Create a new
Errorbar2with no options from a single iterator. - errorbar_
data - Create a new
Errorbarwith no options from a single iterator. - figtext
- Create a new
FigTextwith no options. - fill_
between - Create a new
FillBetweenwith no options. - fill_
between_ data - Create a new
FillBetweenwith no options from a single iterator. - fill_
betweenx - Create a new
FillBetweenXwith no options. - fill_
betweenx_ data - Create a new
FillBetweenXwith 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
Gridwith no options. - hist
- Create a new
Histwith no options. - hist2d
- Create a new
Hist2dwith no options. - hist2d_
pairs - Create a new
Hist2dwith no options from a single iterator. - imshow
- Create a new
Imshowwith no options. - imshow_
flat - Create a new
Imshowfrom a flattened, row-major iterator over image data with row lengthrowlen. - imshow_
flat_ c - Create a new
Imshowfrom a flattened, column-major iterator over image data with column lengthcollen. - init_
grid - Create a new
InitGridwith no options. - init_
gridspec - Create a new
InitGridSpec. - inset_
axes - Create a new
InsetAxeswith no options. - inset_
axes_ pairs - Create a new
InsetAxeswith no options from (x, y) and (width, height) pairs. - invert_
ax - Create a new
InvertAx. - invert_
x - Create a new
InvertAxfor the X-axis. - invert_
y - Create a new
InvertAxfor the Y-axis. - invert_
z - Create a new
InvertAxfor the Z-axis. - label
- Create a new
Labelwith no options. - legend
- Create a new
Legendwith no options. - lim
- Create a new
Lim. - pie
- Create a new
Piewith no options. - plot
- Create a new
Plotwith no options. - plot3
- Create a new
Plot3with no options. - plot3_
data - Create a new
Plot3with no options from a single iterator. - plot_
pairs - Create a new
Plotwith no options from a single iterator. - prelude
- Create a new
Prelude. - quiver
- Create a new
Quiverwith no options. - quiver3
- Create a new
Quiver3with no options. - quiver3_
data - Create a new
Quiver3with no options from a single iterator. - quiver3_
triples - Create a new
Quiver3with no options from iterators over coordinate triples. - quiver_
data - Create a new
Quiverwith 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
Quiverwith 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
Scatterwith no options. - scatter3
- Create a new
Scatter3with no options. - scatter3_
data - Create a new
Scatter3with no options from a single iterator. - scatter_
pairs - Create a new
Scatterwith no options from a single iterator. - stairs
- Create a new
Stairswith no options. - stairs_
pairs - Create a new
Stairswith no options from a single iterator. - stem
- Create a new
Stemwith no options. - stem_
pairs - Create a new
Stemwith no options from a single iterator. - step
- Create a new
Stepwith no options. - step_
pairs - Create a new
Stepwith no options from a single iterator. - suptitle
- Create a new
SupTitlewith no options. - supxlabel
- Create a new
SupXLabelwith no options. - supylabel
- Create a new
SupYLabelwith no options. - surface
- Create a new
Surfacewith no options. - surface_
data - Create a new
Surfacefrom a single flattened, row-major iterator over coordinate data with row lengthrowlen. - surface_
flat - Create a new
Surfacefrom flattened, row-major iterators over coordinate data with row lengthrowlen. - tex_off
- Turn TeX text off.
- tex_on
- Turn TeX text on.
- text
- Create a new
Textwith no options. - tick_
params - Create a new
TickParamswith no options. - ticklabels
- Create a new
TickLabelswith no options. - ticklabels_
data - Create a new
TickLabelswith no options from a single iterator. - ticks
- Create a new
Tickswith no options. - tight_
layout - Create a new
TightLayoutwith no options. - title
- Create a new
Titlewith no options. - trisurf
- Create a new
Trisurfwith no options. - trisurf_
data - Create a new
Trisurfwith no options from a single iterator. - view_
init - Create a new
ViewInitwith no options. - violinplot
- Create a new
Violinplotwith no options. - violinplot_
flat - Create a new
Violinplotfrom a flattened iterator over a number of data set of sizesize. - xlabel
- Create a new
Labelfor the X-axis with no options. - xlim
- Create a new
Limfor the X-axis. - xscale
- Create a new
Scalefor the X-axis. - xtick_
params - Create a new
TickParamsfor the X-axis with no options. - xticklabels
- Create a new
TickLabelsfor the X-axis with no options. - xticklabels_
data - Create a new
TickLabelsfor the X-axis with no options from a single iterator. - xticks
- Create a new
Ticksfor the X-axis with no options. - ylabel
- Create a new
Labelfor the Y-axis with no options. - ylim
- Create a new
Limfor the Y-axis. - yscale
- Create a new
Scalefor the Y-axis. - ytick_
params - Create a new
TickParamsfor the Y-axis with no options. - yticklabels
- Create a new
TickLabelsfor the Y-axis with no options. - yticklabels_
data - Create a new
TickLabelsfor the Y-axis with no options from a single iterator. - yticks
- Create a new
Ticksfor the Y-axis with no options. - zlabel
- Create a new
Labelfor the Z-axis with no options. - zlim
- Create a new
Limfor the Z-axis. - zscale
- Create a new
Scalefor the Z-axis. - zticklabels
- Create a new
TickLabelsfor the Z-axis with no options. - zticklabels_
data - Create a new
TickLabelsfor the Z-axis with no options from a single iterator. - zticks
- Create a new
Ticksfor the Z-axis with no options.