变化超过0.99.x¶
- 的默认行为
matplotlib.axes.Axes.set_xlim()
,matplotlib.axes.Axes.set_ylim()
和matplotlib.axes.Axes.axis()
以及相应的Pyplot函数已更改:当使用这些方法之一显式设置视图限制时,匹配轴的自动缩放功能将关闭。一个新的 auto Kwarg可以控制这种行为。限制Kwargs已重命名为 left 和 正确的 而不是 xmin 和 xmax 和 底部 和 top 而不是 ymin 和 ymax . 不过,旧名称仍可以使用。 - 有五种新的轴方法,具有相应的Pyplot函数,以方便自动缩放、刻度位置和刻度标签格式,以及刻度和刻度标签的一般外观:
matplotlib.axes.Axes.autoscale()
打开或关闭自动缩放,然后应用它。matplotlib.axes.Axes.margins()
设置用于自动缩放matplotlib.axes.Axes.viewLim
基于matplotlib.axes.Axes.dataLim
.matplotlib.axes.Axes.locator_params()
允许调整轴定位器参数,例如 梯度方向数 .matplotlib.axes.Axes.ticklabel_format()
是控制matplotlib.ticker.ScalarFormatter
默认情况下用于线性轴。matplotlib.axes.Axes.tick_params()
控制刻度及其标签的方向、大小、可见性和颜色。
- 这个
matplotlib.axes.Axes.bar()
方法接受 error_kw Kwarg;它是要传递给Errorbar函数的Kwarg字典。 - 这个
matplotlib.axes.Axes.hist()
颜色 Kwarg现在接受一系列颜色规格来匹配一系列数据集。 - 这个
EllipseCollection
已通过两种方式进行了更改:- 有一种新的 单位 选项“xy”,用数据单位缩放椭圆。这与:class:'~matplotlib.patches.Ellipse'缩放匹配。
- 这个 高度 和 宽度 Kwargs已被更改以指定高度和宽度,同样为了与
Ellipse
,以便更好地匹配它们的名称;以前它们指定了半高半宽。
- 有一个新的rc参数
axes.color_cycle
,颜色循环现在独立于rc参数。lines.color
.matplotlib.Axes.set_default_color_cycle
被贬低。 - 现在可以将多个数字打印到一个PDF文件中,并修改PDF文件的文档信息字典。查看类的DocStrings
matplotlib.backends.backend_pdf.PdfPages
更多信息。 - 远离的 configobj 和 enthought.traits 包,这些包只是实验性训练配置所需的,并且有些过时。如果需要,可单独安装。
新的RC参数
savefig.extension
设置由使用的文件扩展名matplotlib.figure.Figure.savefig()
如果其 文件名 参数缺少扩展名。为了简化后端API,现在使用graphicsContext对象传递所有剪切矩形和路径,甚至在集合和图像上也是如此。因此:
draw_path_collection(self, master_transform, cliprect, clippath, clippath_trans, paths, all_transforms, offsets, offsetTrans, facecolors, edgecolors, linewidths, linestyles, antialiaseds, urls) # is now draw_path_collection(self, gc, master_transform, paths, all_transforms, offsets, offsetTrans, facecolors, edgecolors, linewidths, linestyles, antialiaseds, urls) draw_quad_mesh(self, master_transform, cliprect, clippath, clippath_trans, meshWidth, meshHeight, coordinates, offsets, offsetTrans, facecolors, antialiased, showedges) # is now draw_quad_mesh(self, gc, master_transform, meshWidth, meshHeight, coordinates, offsets, offsetTrans, facecolors, antialiased, showedges) draw_image(self, x, y, im, bbox, clippath=None, clippath_trans=None) # is now draw_image(self, gc, x, y, im)
有四种新的轴方法,具有处理非结构化三角形网格的相应Pyplot函数:
matplotlib.axes.Axes.tricontour()
在三角形网格上绘制轮廓线。matplotlib.axes.Axes.tricontourf()
在三角形网格上绘制填充轮廓。matplotlib.axes.Axes.tripcolor()
在三角形网格上绘制伪彩色绘图。matplotlib.axes.Axes.triplot()
绘制三角形网格作为线条和/或标记。