0.99.x 之后的更改#

  • matplotlib.axes.Axes.set_xlim()matplotlib.axes.Axes.set_ylim()matplotlib.axes.Axes.axis() 及其对应的 pyplot 函数的默认行为已更改:当使用这些方法之一明确设置视图限制时,匹配轴的自动缩放功能将关闭。一个新的 auto kwarg 可用于控制此行为。限制参数已重命名为 leftright,而不是 xminxmax,以及 bottomtop,而不是 yminymax。但是,旧名称仍然可以使用。

  • 新增了五个 Axes 方法及其对应的 pyplot 函数,以方便自动缩放、刻度定位和刻度标签格式设置,以及刻度和刻度标签的整体外观。

  • matplotlib.axes.Axes.bar() 方法接受一个 error_kw kwarg;它是一个要传递给误差条函数的 kwarg 字典。

  • matplotlib.axes.Axes.hist()color kwarg 现在接受颜色规范序列以匹配数据集序列。

  • EllipseCollection 已通过两种方式更改

    • 新增了一个 units 选项,'xy',它以数据单位缩放椭圆。这与 :class:'~matplotlib.patches.Ellipse` 的缩放方式一致。

    • heightwidth kwarg 已更改为指定高度和宽度,再次与 Ellipse 保持一致,并更好地匹配它们的名称;以前它们指定的是半高和半宽。

  • 新增了一个 rc 参数 axes.color_cycle,并且颜色循环现在独立于 rc 参数 lines.colormatplotlib.Axes.set_default_color_cycle 已弃用。

  • 您现在可以将多个图形打印到一个 pdf 文件中,并修改 pdf 文件的文档信息字典。有关更多信息,请参阅 matplotlib.backends.backend_pdf.PdfPages 类的 docstrings。

  • 移除了 configobjenthought.traits 包,它们仅由实验性 traited config 需要,并且有些过时。如果需要,请单独安装它们。

  • 新的 rc 参数 savefig.extension 设置 matplotlib.figure.Figure.savefig() 使用的文件名扩展名,如果其 fname 参数缺少扩展名。

  • 为了简化后端 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)
    
  • 新增了四个 Axes 方法及其对应的 pyplot 函数,用于处理非结构化三角形网格。