Overview
Basic plotting functions provide fundamental chart types for visualizing data.Functions
plot
Plot a connected line series on the current axes.X-axis values
Y-axis values
Plot styling options (color, linewidth, label, etc.)
scatter
Plot unconnected points on the current axes.X-axis values
Y-axis values
Plot styling options (color, size, label, etc.)
bar
Plot vertical bars on the current axes.X-axis positions
Bar heights
Plot styling options
barh
Plot horizontal bars on the current axes.Y-axis positions
Bar widths
Plot styling options
hist
Plot a histogram on the current axes.Data values
Number of bins (default: 10) or options object
Plot styling options
heatmap
Plot a heatmap for a 2D tensor.2D tensor data
Plot styling options (colormap, vmin, vmax, etc.)
imshow
Display a matrix as an image (alias of heatmap).2D tensor data
Plot styling options
contour
Plot contour lines for a 2D grid.X-coordinate grid
Y-coordinate grid
Z values at grid points
Plot styling options
contourf
Plot filled contours for a 2D grid.X-coordinate grid
Y-coordinate grid
Z values at grid points
Plot styling options
boxplot
Plot a box-and-whisker summary on the current axes.Data values
Plot styling options
violinplot
Plot a violin summary on the current axes.Data values
Plot styling options
pie
Plot a pie chart on the current axes.Slice values
Optional labels for each slice
Plot styling options
Rendering
show
Render a figure to SVG or PNG.Figure to render (default: current figure)
Output format:
'svg' (default) or 'png'Rendered figure
saveFig
Save a figure to disk as SVG or PNG.Output file path (extension must match format)
Figure to save (default: current figure)
Output format:
'svg' or 'png' (inferred from extension if not specified)legend
Show or configure a legend on the current axes.Legend configuration options