logo资料库

Matplotlib中文手册.pdf

第1页 / 共77页
第2页 / 共77页
第3页 / 共77页
第4页 / 共77页
第5页 / 共77页
第6页 / 共77页
第7页 / 共77页
第8页 / 共77页
资料共77页,剩余部分请下载后查看
matplotlib 函数手册 星猫译
函数 acorr 介绍 Plot the autocorrelation of x.绘制 X 的自相关 Create an annotation: a piece of text referring to a data annotate point. 用箭头在指定的一个数据点创建一个注释或一段文本。 arrow Add an arrow to the axes.为 axes 添加一个箭头。 autoscale Autoscale the axis view to the data (toggle).自动缩放轴视图的 数据(切换)。 axes Add an axes to the figure.为当前 figure 添加一个 axes。 axhline axhspan axis Add a horizontal line across the axis.添加一条穿越 axis 的水平 线。 Add a horizontal span (rectangle) across the axis.添加一条穿 越 axis 的水平矩形。 Convenience method to get or set axis properties.获取或设置轴 属性的便捷方法。 axvline Add a vertical line across the axes.添加一条穿越 axes 的垂线。 axvspan bar barbs barh box Add a vertical span (rectangle) across the axes.添加一个与 axes 交叉的垂直跨度(矩形)。 Make a bar plot.做一个垂直条形图。 Plot a 2-D field of barbs.绘制一个倒钩的二维场(风场)。 Make a horizontal bar plot.做一个横向条形图。 Turn the axes box on or off.打开或关闭主轴箱。 boxplot Make a box and whisker plot.使一盒须图。 broken_barh Plot horizontal bars.绘制水平杆。 cla Clear the current axes.清除当前 axes。 clabel Label a contour plot. 为等值线图设标签 clf Clear the current figure.清除当前 figure。 clim Set the color limits of the current image.设置当前图像的颜色 取值范围。 close Close a figure window.关闭 figure 窗口。 cohere Plot the coherence between x and y.绘制 X 和 Y 之间的相关性分 析
colorbar Add a colorbar to a plot.为图添加彩条标值。 contour Plot contours.绘制等值线。 contourf Plot contours.绘制填充等值线。 csd Plot cross-spectral density.绘制交叉谱密度。 delaxes Remove an axes from the current figure.从目前的 figure 删除 axes。 draw Redraw the current figure.再次绘制当前 figure。 errorbar Plot an errorbar graph.绘制 errorbar 图。 eventplot figimage Plot identical parallel lines at specific positions.在特定的 位置绘制相同的平行线。 Adds a non-resampled image to the figure.为 figure 添加一个非 重采样图像。 figlegend Place a legend in the figure.为 figure 放置一个标注(legend) figtext Add text to figure.为 figure 添加文字。 figure Creates a new figure.创建一个新的 figure。 fill Plot filled polygons.绘制填充多边形。 fill_between Make filled polygons between two curves.使两曲线间填充色彩。 fill_betweenx Make filled polygons between two horizontal curves.使两水平线 间填充色彩。 findobj Find artist objects.发现 artist 对象。 gca gcf gci get_figlabels get_fignums Return the current axis instance.返回当前轴实例(axis instance)。 Return a reference to the current figure.返回当前 figure 的序 号。 Get the current colorable artist.获取当前彩条的 artist。 Return a list of existing figure labels.返回一个当前 figure 的 标签列表。 Return a list of existing figure numbers.返回一系列 figure 的 序号。 grid(on/off) Turn the axes grids on or off.打开或关闭坐标网格。 hexbin Make a hexagonal binning plot.做一个六边形箱图。 hist Plot a histogram.绘制直方图。 hist2d Make a 2D histogram plot.使一个二维直方图。
hlines Plot horizontal lines.绘制水平线。 hold Set the hold state.设置 hold 状态。 imread imsave imshow ioff ion ishold Read an image from a file into an array.读取一个图像,从图形 文件中提取数组。 Save an array as in image file.保存为图像文件中的数组。 Display an image on the axes.在 axes 上显示图像。 Turn interactive mode off. 关闭互动模式。 Turn interactive mode on.开启互动模式。 Return the hold status of the current axes.返回当前 axes 的 hold 状态。 isinteractive Return status of interactive mode.返回互动模式状态。 legend Place a legend on the current axes.为当前 axes 放置标注。 locator_params Control behavior of tick locators.控制轴刻度标签 loglog Make a plot with log scaling on both the x and y axis.使 X、 Y 轴为 log 刻度。 margins Set or retrieve autoscaling margins.设置或检索自动缩放功能。 matshow minorticks_off minorticks_on over Display an array as a matrix in a new figure window.在新 figure 窗口显示数组矩阵 Remove minor ticks from the current plot.移除当前数轴上的次刻 度 Display minor ticks on the current plot.显示当前数轴上的次刻 度 Call a function with hold(True).调用一个函数,并且 hold 为 (True)。 pause Pause for interval seconds.Pause 的时间间隔(秒)。 pcolor Create a pseudocolor plot of a 2-D array.创建一个二维阵列的伪 彩色图。 pcolormesh Plot a quadrilateral mesh.绘制一个四边形网格。 pie plot Plot a pie chart.绘制一个饼图。 Plot lines and/or markers to the Axes.绘制当前 axes。 plot_date Plot with data with dates.绘制数据日期。 plotfile Plot the data in in a file.将图绘入文件 polar Make a polar plot.绘制极坐标图。
psd Plot the power spectral density.绘制功率谱密度图。 quiver Plot a 2-D field of arrows.绘制二维箭头图(风矢量图)。 quiverkey Add a key to a quiver plot.为风矢量图绘制单位标量 rc Set the current rc params.设置当前的 RC 参数。 rc_context Return a context manager for managing rc settings.返回一个用 于管理 RC 设置上下文管理器。 rcdefaults Restore the default rc params.恢复默认的 RC 参数。 rgrids Get or set the radial gridlines on a polar plot.获取或设置径 向网格在极坐标图。 savefig Save the current figure.保存当前图。 sca Set the current Axes instance to ax.为 ax 设置当前(axes)轴实 例。 Make a scatter plot of x vs y, where x and y are sequence scatter like objects of the same lengths.做一个 X 和 Y 的散点图,其中 X 和 Y 是相同长度的序列的对象。 sci Set the current image.设置当前的图像。 semilogx Make a plot with log scaling on the x axis.使 x 轴为 log 刻度。 semilogy Make a plot with log scaling on the y axis.使 y 轴为 log 刻度。 set_cmap Set the default colormap.设置默认的 colormap。 setp show Set a property on an artist object.对 artist 对象设置属性。 Display a figure.显示图。 specgram Plot a spectrogram.绘制谱图。 spy Plot the sparsity pattern on a 2-D array.绘制一个二维阵列的稀 疏模式。 stackplot Draws a stacked area plot.绘制一个堆叠面积图。 stem step Create a stem plot.创造一个 stem 图。 Make a step plot.做一个步阶图 streamplot Draws streamlines of a vector flow.绘制一个流场图。 subplot Return a subplot axes positioned by the given grid definition.返回一个 subplot axes subplot2grid Create a subplot in a grid.在网格中创建一个 subplot。 subplot_tool Launch a subplot tool window for a figure.获取 subplot 工具窗 口。
subplots Create a figure with a set of subplots already made.一个图中包含多个子图 subplots_adjust Tune the subplot layout.调整 subplot 布局 suptitle Add a centered title to the figure.在图添加一个中心标题。 switch_backend Switch the default backend.交换机默认的后台。 table text thetagrids tick_params Add a table to the current axes.当前 axes 添加 table。 Add text to the axes.在轴上添加文本。 Get or set the theta locations of the gridlines in a polar plot.设置极坐标网格线 θ 位置。 Change the appearance of ticks and tick labels.改变刻度及刻度 标签外观 ticklabel_format tight_layout Change the ScalarFormatter used by default for linear axes.通 过使用默认线性 axes 轴更改 scalarformatter 。 Automatically adjust subplot parameters to give specified padding.自动调节 subplot 参数进行指定填充。 title Set a title of the current axes.设置当前 axes 标题。 tricontour tricontourf tripcolor triplot twinx twiny Draw contours on an unstructured triangular grid.在非结构三角 形网格绘制等值线。 Draw contours on an unstructured triangular grid.在非结构三角 形网格绘制填充等值线。 Create a pseudocolor plot of an unstructured triangular grid.创建一个非结构三角形网格伪彩色图。 Draw a unstructured triangular grid as lines and/or markers.画一个非结构三角形网格图(类似 plot 函数)。 Make a second axes that shares the x-axis.制作第二个 axes,并 共用 x 轴。 Make a second axes that shares the y-axis.制作第二个 axes,并 共用 y 轴。 vlines Plot vertical lines.绘制垂直线。 xcorr xkcd Plot the cross correlation between x and y.绘制 x 和 y 的相关性 分析图 Turns on xkcd sketch-style drawing mode.开启 XKCD 草图风格绘 画模。
xlabel xlim Set the x axis label of the current axis.在当前轴设置 X 轴的 标签。 Get or set the x limits of the current axes.设置当前 axes 的 x 轴取值范围 xscale Set the scaling of the x-axis.设置 X 轴缩放。 xticks ylabel ylim Get or set the x-limits of the current tick locations and labels.设置当前 x 轴刻度位置的标签和值。 Set the y axis label of the current axis.设置当前轴 y 轴标签。 Get or set the y-limits of the current axes.设置当前 axes 的 y 轴取值范围 yscale Set the scaling of the y-axis.设置 Y 轴缩放。 yticks Get or set the y-limits of the current tick locations and labels.设置当前 y 轴刻度位置的标签和值。
函数: 1. matplotlib.pyplot.acorr(x, hold=None, **kwargs) 自相关函数 acorr(x, normed=True, detrend=mlab.detrend_none, usevlines=True, maxlags=10, **kwargs) #x 的自相关 如果 normed = True,通过零滞后自相关规范数据,x 通过非趋势可调用(默认没有归 一化)的方式除趋势 数据绘制形如 plot(lags, c, **kwargs) 返回值是元组(lags, c, line),其中: ¥lags 是一个长度为 2×maxlags + 1 的滞后(lags)向量 ¥C 是 2×maxlags + 1 的自相关向量 ¥line 是一个 line2d 实例,通过 plot()返回 默认 linestyle 是 None,默认的 marker 是'o',交叉相关性是通过 numpy.correlate()函 数、mode = 2 实现的。 若 usevlines 是 True, vlines()将被调用(而不调用 plot()函数),用来绘制从起点 到 acorr 的垂线。否则,plot()由 Line2D properties 属性参数(kwargs)决定。 maxlags 是正整数,决定 lags 的显示数目。默认值 None 将返回(2×len(x)- 1) 个 lags,返回值是一个元组(lags, c, linecol, b),其中: linecol 是 linecollection b 是 x-axis 其他参数参见 Line2D的 kwargs 属性 2 . matplotlib.pyplot.annotate(*args, **kwargs) 创建一个文本注释:从指定点指向目标点 annotate('注释内容', xy, xytext=None,xycoords='data',textcoords='data', arrowprops=None, **kwargs) xy:被注释点的位置,xytext:注释文本的位置坐标 xycoords 和 textcoords 是字符串,指示 xy 和 xytext 的坐标关系: Property ‘figure points’ ‘figure pixels’ Description points from the lower left corner of the figure pixels from the lower left corner of the figure 起点从 figure 左下角 pixels(像素)从 figure 左 下角
分享到:
收藏