Matplotlib 命令总结

http://matplotlib.org/api/pyplot_summary.html

作图命令

方法描述类型
angle_spectrumPlot the angle spectrum.plot
arrowAdd an arrow to the axes.plot
barMake a bar plot.plot
barbsPlot a 2-D field of barbs.plot
barhMake a horizontal bar plot.plot
boxplotMake a box and whisker plot.plot
broken_barhPlot horizontal bars.Plot
coherePlot the coherence between?x?and?y.plot
contourPlot contours.plot
contourfPlot contours.plot
csdPlot the cross-spectral density.plot
errorbarPlot an errorbar graph.plot
eventplotPlot identical parallel lines at specific positions.plot
fillPlot filled polygons. 做面积图plot
fill_betweenMake filled polygons between two curves.
fill_betweenxMake filled polygons between two horizontal curves.
hexbinMake a hexagonal binning plot.plot
histPlot a histogram.plot
hist2dMake a 2D histogram plot.plot
loglogMake a plot with log scaling on both the?x?and?y?axis.plot
magnitude_spectrumPlot the magnitude spectrum.Plot
pcolormeshPlot a quadrilateral mesh.Plot
phase_spectrumPlot the phase spectrum.Plot
piePlot a pie chart.Plot
plotPlot lines and/or markers to the?Axes.Plot
plot_dateA plot with data that contains dates.Plot
plotfilePlot the data in in a file.Plot
polarMake a polar plot.plot
thetagridsGet or set the theta locations of the gridlines in a polar plot.
psdPlot the power spectral density.Plot
quiverPlot a 2-D field of arrows.Plot
scatterMake a scatter plot of?x?vs?y?Marker size is scaled by?s?and marker color is mapped to?cParameters ———- x, y : array_like, shape (n, ) Input data s : scalar or array_like, shape (n, ), optional size in points^2.plot
semilogxMake a plot with log scaling on the?x?axis.plot
semilogyMake a plot with log scaling on the?y?axis.plot
specgramPlot a spectrogram.Plot
spyPlot the sparsity pattern on a 2-D array.Plot
stemCreate a stem plot.plot
stepMake a step plot.plot
streamplotDraws streamlines of a vector flow.plot
violinplotMake a violin plot.Plot
xcorrPlot the cross correlation between?x?and?y.Plot
acorrPlot the autocorrelation of?x.

坐标轴命令

方法描述类型
axisConvenience method to get or set axis properties.axis
yticksGet or set the?y-limits of the current tick locations and labels.yticks
yscaleSet the scaling of the?y-axis.yscale
ylimGet or set the?y-limits of the current axes.ylim
ylabelSet the?y?axis label of the current axis.ylabel
xticksGet or set the?x-limits of the current tick locations and labels.xticks
xscaleSet the scaling of the?x-axis.xscale
xlimGet or set the?x?limits of the current axes.xlim
xlabelSet the?x?axis label of the current axis.xlabel
minorticks_offRemove minor ticks from the current plot.ticks
minorticks_onDisplay minor ticks on the current plot.ticks
autoscaleAutoscale the axis view to the data (toggle).scale

图文说明命令

方法描述类型
suptitleAdd a centered title to the figure.title
titleSet a title of the current axes.title
figtextAdd text to figure.text
textAdd text to the axes.text
grid控制背景网格线axes
tableAdd a table to the current axes.table
figlegendPlace a legend in the figure.legend
legendPlaces a legend on the axes.legend
annotateAnnotate the point?xy?with text?s.Annotate
colorbarAdd a colorbar to a plot.colorbar
set_cmapSet the default colormap.

辅助线

方法描述类型
vlinesPlot vertical lines.vlines
hlinesPlot horizontal lines at each?y?from?xmin?to?xmax.hlines
axvspanAdd a vertical span (rectangle) across the axes.axvspan
axvlineAdd a vertical line across the axes.axvline
axhspanAdd a horizontal span (rectangle) across the axis.axhspan
axhlineAdd a horizontal line across the axis.axhline
twinxMake a second axes that shares the?x-axis.axes
twinyMake a second axes that shares the?y-axis.axes

图片

方法描述类型
imreadRead an image from a file into an array.image
imsaveSave an array as in image file.image
imshowDisplay an image on the axes.image
climSet the color limits of the current image.image
sciSet the current image.image

figure

方法描述类型
figureCreates a new figure.figure
figimageAdds a non-resampled image to the figure.figimage
clfClear the current figure.figure
closeClose a figure window.figure
drawRedraw the current figure.figure
gcfGet a reference to the current figure.figure
savefigSave the current figure.
showDisplay a figure.
get_figlabelsReturn a list of existing figure labels.figure
get_fignumsReturn a list of existing figure numbers.figure

axes

方法描述类型
axesAdd an axes to the figure.axes
boxTurn the axes box on or off.axes
claClear the current axes.axes
delaxesRemove an axes from the current figure.axes
gcaGet the current?Axes?instance on the current figure matching the given keyword args, or create one.axes
scaSet the current Axes instance to?ax.axes
subplotReturn a subplot axes positioned by the given grid definition.axes
subplot2gridCreate a subplot in a grid.axes
subplot_toolLaunch a subplot tool window for a figure.axes
subplotsCreate a figure and a set of subplots This utility wrapper makes it convenient to create common layouts of subplots, including the enclosing figure object, in a single call.axes
subplots_adjustTune the subplot layout.axes

其他

方法描述类型
stackplotDraws a stacked area plot.Draws
clabelLabel a contour plot.
fignum_exists
findobjFind artist objects.
gciGet the current colorable artist.
hold
install_repl_displayhookInstall a repl display hook so that any stale figure are automatically redrawn when control is returned to the repl.
ioffTurn interactive mode off.
ionTurn interactive mode on.
ishold
isinteractiveReturn status of interactive mode.
locator_paramsControl behavior of tick locators.
marginsSet or retrieve autoscaling margins.
matshowDisplay an array as a matrix in a new figure window.
over
pausePause for?interval?seconds.
pcolorCreate a pseudocolor plot of a 2-D array.
quiverkeyAdd a key to a quiver plot.
rcSet the current rc params.
rc_contextReturn a context manager for managing rc settings.
rcdefaultsRestore the rc params from Matplotlib’s internal defaults.
rgridsGet or set the radial gridlines on a polar plot.
setpSet a property on an artist object.
switch_backendSwitch the default backend.
tick_paramsChange the appearance of ticks and tick labels.
ticklabel_formatChange the?ScalarFormatter?used by default for linear axes.
tight_layoutAutomatically adjust subplot parameters to give specified padding.
tricontourDraw contours on an unstructured triangular grid.
tricontourfDraw contours on an unstructured triangular grid.
tripcolorCreate a pseudocolor plot of an unstructured triangular grid.
triplotDraw a unstructured triangular grid as lines and/or markers.
uninstall_repl_displayhookUninstalls the matplotlib display hook.
xkcdTurns on?xkcd?sketch-style drawing mode.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值