matplotlib.pyplot 所有方法目录

matplotlib.pyplot 所有方法目录

关于pyplot, 基本20%的函数就完成80%的应用了 , 本文翻译了官方文档的pyplot1方法表格。看看pyplot还能做哪些事,大概了解还有哪些功能,需要用的时候心里有数。加粗的是常用的方法。

方法官方描述功能
acorrPlot the autocorrelation of x.画出x的自相关性
angle_spectrumPlot the angle spectrum.绘制角度谱。
annotateAnnotate the point xy with text text.给点xy加文本注释
arrowAdd an arrow to the axes.在横轴上加一条水平线
autoscaleAutoscale the axis view to the data (toggle).自动度量数据的axis视图(切换)
axesAdd an axes to the current figure and make it the current axes.向当前图形添加一个轴,并使其成为当前轴。
axhlineAdd a horizontal line across the axis.在横轴上加一条水平线。
axhspanAdd a horizontal span (rectangle) across the axis.添加横轴的水平跨度(矩形)
axisConvenience method to get or set some axis properties.方便的方法获取或设置一些轴属性。
axvlineAdd a vertical line across the axes.在坐标轴上加一条垂直线
axvspanAdd a vertical span (rectangle) across the axes.在坐标轴上增加一个垂直的跨度(矩形)。
barMake a bar plot.做个柱状图。
barbsPlot a 2D field of barbs.绘制一个2D向量场。
barhMake a horizontal bar plot.做一个水平柱状图。
boxTurn the axes box on or off on the current axes.打开或关闭当前轴上的轴框
boxplotMake a box and whisker plot.箱线图
broken_barhPlot a horizontal sequence of rectangles.绘制矩形的水平序列。
claClear the current axes.清除当前轴。
clabelLabel a contour plot.标记等高线图。
clfClear the current figure.清除当前图形。
climSet the color limits of the current image.设置当前图像的颜色限制。
closeClose a figure window.关闭图形窗口。
coherePlot the coherence between x and y.绘制x和y之间的相干性。
colorbarAdd a colorbar to a plot.在绘图中添加一个彩色条。
contourPlot contours.画等高线图
contourfPlot contours.画等高线图
csdPlot the cross-spectral density.绘制交叉谱密度。
delaxesRemove the Axes ax (defaulting to the current axes) from its figure.从其图形中删除ax轴(默认为当前轴)
drawRedraw the current figure.重画当前图形。
errorbarPlot y versus x as lines and/or markers with attached errorbars.将y与x绘制成直线和/或带有附加错误条的标记。
eventplotPlot identical parallel lines at the given positions.在给定位置绘制相同的平行线。
figimageAdd a non-resampled image to the figure.向图中添加一个未重新采样的图像
figlegendPlace a legend on the figure.在图形上放一个图例。
fignum_existsReturn whether the figure with the given id exists.返回具有给定id的图是否存在。
figtextAdd text to figure.添加文本到图
figureCreate a new figure.创建一个新图。
fillPlot filled polygons.图填充多边形
fill_betweenFill the area between two horizontal curves. 填充两条水平曲线之间的区域。
fill_betweenxFill the area between two vertical curves.v填充两条垂直曲线之间的区域
findobjFind artist objects.找到Artist对象
gcaGet the current Axes instance on the current figure matching the given keyword args, or create one.获取与给定关键字args匹配的当前图形上的当前轴实例,或创建一个
gcfGet the current figure.获取当前图片。
gciGet the current colorable artist.获取当前的可着色Artist。
get_figlabelsReturn a list of existing figure labels.返回现有图形标签的列表
get_fignumsReturn a list of existing figure numbers.返回现有图号的列表。
gridConfigure the grid lines.配置网格线
hexbinMake a 2D hexagonal binning plot of points x, y.做一个点x, y的二维六边形宾线图。
histPlot a histogram.绘制一个直方图
hist2dMake a 2D histogram plot.做一个二维直方图图。
hlinesPlot horizontal lines at each y from xmin to xmax.绘制y轴xmin至xmax处的水平线
imreadRead an image from a file into an array.将图像从文件中读取到数组中
imsaveSave an array as an image file.将数组保存为图像文件
imshowDisplay data as an image; i.e.以图像的形式显示数据
install_repl_displayhookInstall a repl display hook so that any stale figure are automatically redrawn when control is returned to the repl.安装一个repl显示钩子,这样当控制权返回到repl时,任何陈旧的图形都会自动重绘。
ioffTurn the interactive mode off.关闭交互模式
ionTurn the interactive mode on.打开交互模式
isinteractiveReturn whether to redraw after every plotting command.返回是否重新绘制后,每个绘图命令
legendPlace a legend on the axes.在坐标轴上放一个图例。
locator_paramsControl behavior of major tick locators.控制主要刻度定位器的行为。
loglogMake a plot with log scaling on both the x and y axis.在x轴和y轴上做一个对数缩放的图
magnitude_spectrumPlot the magnitude spectrum.绘制震级谱。
marginsSet or retrieve autoscaling margins.设置或检索自动缩放边距。
matshowDisplay an array as a matrix in a new figure window.在一个新的图形窗口中以矩阵的形式显示数组。
minorticks_offRemove minor ticks from the axes.从轴中删除小刻度。
minorticks_onDisplay minor ticks on the axes.在轴上显示小刻度
pausePause for interval seconds.间隔秒暂停。
pcolorCreate a pseudocolor plot with a non-regular rectangular grid.创建一个非规则矩形网格的伪色图。
pcolormeshCreate a pseudocolor plot with a non-regular rectangular grid.创建一个非规则矩形网格的伪色图
phase_spectrumPlot the phase spectrum.绘制相谱图。
piePlot a pie chart.画一个饼图。
plotPlot y versus x as lines and/or markers.图y和x作为直线和/或标记。
plot_datePlot data that contains dates.包含日期的绘图数据。
plotfile[Deprecated] Plot the data in a file.[已弃用]在文件中绘制数据。
polarMake a polar plot.极坐标画一个极坐标图。
psdPlot the power spectral density.绘制功率谱密度
quiverPlot a 2D field of arrows.画一个2D的箭头场。
quiverkeyAdd a key to a quiver plot.给箭头添加一个键。
rcSet the current rc params.设置当前rc参数
rc_contextReturn a context manager for managing rc settings.返回一个上下文管理器来管理rc设置
rcdefaultsRestore the rc params from Matplotlib’s internal default style.从Matplotlib的内部默认样式中恢复rc参数
rgridsGet or set the radial gridlines on the current polar plot.获取或设置当前极线图上的径向网格线。
savefigSave the current figure.保存当前图形。
scaSet the current Axes instance to ax.将当前的Axes实例设置为ax
scatterA scatter plot of y vs.y和的散点图
sciSet the current image.设置当前图像。
semilogxMake a plot with log scaling on the x axis.在x轴上做一个对数缩放图。
semilogyMake a plot with log scaling on the y axis.在y轴上用对数尺度做一个图
set_cmapSet the default colormap, and applies it to the current image if any.设置默认的颜色映射,并将其应用于当前图像(如果有的话)。
setpSet a property on an artist object.在artist对象上设置一个属性。
showDisplay all figures.显示所有图。
specgramPlot a spectrogram.谱图
spyPlot the sparsity pattern of a 2D array.绘制二维数组的稀疏模式
stackplotDraw a stacked area plot.绘制堆叠区域图。
stemCreate a stem plot.创建一个茎区。
stepMake a step plot.做一个阶梯图。
streamplotDraw streamlines of a vector flow.绘制矢量流的流线。
subplotAdd a subplot to the current figure.在当前图中添加一个子图。
subplot2gridCreate an axis at specific location inside a regular grid.在规则网格的特定位置创建一个轴
subplot_toolLaunch a subplot tool window for a figure.启动子图绘制工具窗口
subplotsCreate a figure and a set of subplots.创建一个图和一组子图。
subplots_adjustTune the subplot layout.调整子地块布局
suptitleAdd a centered title to the figure.在图中添加一个居中标题
switch_backendClose all open figures and set the Matplotlib backend.关闭所有打开的图形并设置Matplotlib后端。
tableAdd a table to an Axes.向坐标轴添加一个表。
textAdd text to the axes.添加文本到轴
thetagridsGet or set the theta gridlines on the current polar plot.获取或设置当前极坐标图上的theta网格线
tick_paramsChange the appearance of ticks, tick labels, and gridlines.更改刻度、刻度标签和网格线的外观。
ticklabel_formatChange the ScalarFormatter used by default for linear axes.更改默认用于线性轴的ScalarFormatter
tight_layoutAutomatically adjust subplot parameters to give specified padding.自动调整子图参数以提供指定的填充。
titleSet a title for the axes.设置坐标轴的标题。
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.画一个非结构化的三角形网格作为线和/或标记
twinxMake and return a second axes that shares the x-axis.生成并返回第二个共享x轴的轴
twinyMake and return a second axes that shares the y-axis.制造并返回共享y轴的第二个轴
uninstall_repl_displayhookUninstall the matplotlib display hook.卸载matplotlib显示钩子
violinplotMake a violin plot.制作小提琴图
vlinesPlot vertical lines.绘制垂直线。
xcorrPlot the cross correlation between x and y.绘制x和y之间的互相关系。
xkcdTurn on xkcd sketch-style drawing mode.打开xkcd素描式绘制模式
xlabelSet the label for the x-axis.设置x轴的标签
xlimGet or set the x limits of the current axes.获取或设置当前轴的x限制。
**xscale** Set the x-axis scale.设置x轴比例。
xticksGet or set the current tick locations and labels of the x-axis.获取或设置x轴的当前刻度位置和标签。
ylabelSet the label for the y-axis.设置y轴的标签
ylimGet or set the y-limits of the current axes.获取或设置当前轴的y限。
yscaleSet the y-axis scale.设置y轴比例。
yticksGet or set the current tick locations and labels of the y-axis.获取或设置y轴的当前刻度点位置和标签。

  1. pyplot官方文档,https://matplotlib.org/api/pyplot_summary.html ↩︎

  • 2
    点赞
  • 22
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值