New release
matplotlib 0.98.1 is a major release which requires python2.4 or 2.5 and numpy 1.1. It contains significant improvements and may require some advanced users to update their code; see migration and API_CHANGES. We are supporting a maintenance branch of the older code available at matplotlib 0.91.4. Basemap users see basemap-readme for upgrade instructions

Donate
Help support matplotlib development by donating to fund developer sprints and other matplotlib development costs.

Matplotlib
Home
What's New
Download
Installing
Screenshots
Examples (zip)
Mailing lists
Donate

Documentation
Tutorial
User's Guide 
API tutorial
Event handling
API Reference
FAQ
Cookbook / wiki
pylab interface
Class library
Backends
Toolkits
Fonts
Interactive
Goals

Other
Credits
License

  

Matlab(TM) compatible commands

Matplotlib provides a number of matlab compatible plotting commands. In addition to these, a large number of matlab compatible commands are provided by numpy. Below is a (growing) list of matlab compatible commands.

In addition, scipy provides many more commands, but due to it's size, I haven't committed yet to making it a requirement for matplotlib.


Plotting commands

FunctionDescription
acorrplot the autocorrelation function
annotateannotate something in the figure
arrowadd an arrow to the axes
axesCreate a new axes
axhlinedraw a horizontal line across axes
axvlinedraw a vertical line across axes
axhspandraw a horizontal bar across axes
axvspandraw a vertical bar across axes
axisSet or return the current axis limits
barmake a bar chart
barha horizontal bar chart
broken_barha set of horizontal bars with gaps
boxset the axes frame on/off state
boxplotmake a box and whisker plot
claclear current axes
clabellabel a contour plot
clfclear a figure window
climadjust the color limits of the current image
closeclose a figure window
colorbaradd a colorbar to the current figure
coheremake a plot of coherence
contourmake a contour plot
contourfmake a filled contour plot
csdmake a plot of cross spectral density
delaxesdelete an axes from the current figure
drawForce a redraw of the current figure
errorbarmake an errorbar graph
figlegendmake legend on the figure rather than the axes
figimagemake a figure image
figtextadd text in figure coords
figurecreate or change active figure
fillmake filled polygons
gcareturn the current axes
gcfreturn the current figure
gciget the current image, or None
getpget a handle graphics property
gridset whether gridding is on
histmake a histogram
holdset the axes hold state
ioffturn interaction mode off
ionturn interaction mode on
isinteractivereturn True if interaction mode is on
imreadload image file into array
imshowplot image data
isholdreturn the hold state of the current axes
legendmake an axes legend
logloga log log plot
matshowdisplay a matrix in a new figure preserving aspect
pcolormake a pseudocolor plot
pcolormeshmake a pseudocolor plot using a quadrilateral mesh
piemake a pie chart
plotmake a line plot
plot_dateplot dates
plotfileplot column data from an ASCII tab/space/comma delimited file
piepie charts
polarmake a polar plot on a PolarAxes
psdmake a plot of power spectral density
quivermake a direction field (arrows) plot
rccontrol the default params
rgridscustomize the radial grids and labels for polar
savefigsave the current figure
scattermake a scatter plot
setpset a handle graphics property
semilogxlog x axis
semilogylog y axis
showshow the figures
specgrama spectrogram plot
spyplot sparsity pattern using markers or image
stemmake a stem plot
subplotmake a subplot (numrows, numcols, axesnum)
subplots_adjustchange the params controlling the subplot positions of current figure
subplot_toollaunch the subplot configuration tool
suptitleadd a figure title
tableadd a table to the plot
textadd some text at location x,y to the current axes
thetagridscustomize the radial theta grids and labels for polar
titleadd a title to the current axes
xcorrplot the autocorrelation function of x and y
xlimset/get the xlimits
ylimset/get the ylimits
xticksset/get the xticks
yticksset/get the yticks
xlabeladd an xlabel to the current axes
ylabeladd a ylabel to the current axes
autumnset the default colormap to autumn
boneset the default colormap to bone
coolset the default colormap to cool
copperset the default colormap to copper
flagset the default colormap to flag
grayset the default colormap to gray
hotset the default colormap to hot
hsvset the default colormap to hsv
jetset the default colormap to jet
pinkset the default colormap to pink
prismset the default colormap to prism
springset the default colormap to spring
summerset the default colormap to summer
winterset the default colormap to winter
spectralset the default colormap to spectral


Event handling

FunctionDescription
connectregister an event handler
disconnectremove a connected event handler


Matrix commands

FunctionDescription
cumprodthe cumulative product along a dimension
cumsumthe cumulative sum along a dimension
detrendremove the mean or besdt fit line from an array
diagthe k-th diagonal of matrix
diffthe n-th differnce of an array
eigthe eigenvalues and eigen vectors of v
eyea matrix where the k-th diagonal is ones, else zero
findreturn the indices where a condition is nonzero
fliplrflip the rows of a matrix up/down
flipudflip the columns of a matrix left/right
linspacea linear spaced vector of N values from min to max inclusive
logspacea log spaced vector of N values from min to max inclusive
meshgridrepeat x and y to make regular matrices
onesan array of ones
randan array from the uniform distribution [0,1]
randnan array from the normal distribution
rot90rotate matrix k*90 degress counterclockwise
squeezesqueeze an array removing any dimensions of length 1
tria triangular matrix
trila lower triangular matrix
triuan upper triangular matrix
vanderthe Vandermonde matrix of vector x
svdsingular value decomposition
zerosa matrix of zeros


Probability

FunctionDescription
levypdfThe levy probability density function from the char. func.
normpdfThe Gaussian probability density function
randrandom numbers from the uniform distribution
randnrandom numbers from the normal distribution


Statistics

FunctionDescription
corrcoefcorrelation coefficient
covcovariance matrix
amaxthe maximum along dimension m
meanthe mean along dimension m
medianthe median along dimension m
aminthe minimum along dimension m
normthe norm of vector x
prodthe product along dimension m
ptpthe max-min along dimension m
stdthe standard deviation along dimension m
asumthe sum along dimension m


Time series analysis

FunctionDescription
bartlettM-point Bartlett window
blackmanM-point Blackman window
coherethe coherence using average periodiogram
csdthe cross spectral density using average periodiogram
fftthe fast Fourier transform of vector x
hammingM-point Hamming window
hanningM-point Hanning window
histcompute the histogram of x
kaiserM length Kaiser window
psdthe power spectral density using average periodiogram
sincthe sinc function of array x


Dates

FunctionDescription
date2numconvert python datetimes to numeric representation
drangecreate an array of numbers for date plots
num2dateconvert numeric type (float days since 0001) to datetime


Other

FunctionDescription
anglethe angle of a complex array
loadload ASCII data into array
polyfitfit x, y to an n-th order polynomial
polyvalevaluate an n-th order polynomial
rootsthe roots of the polynomial coefficients in p
savesave an array to an ASCII file
trapztrapezoidal integration



Powered by
YAPTU!
Matlab® is a registered trademark of The MathWorks