Matplotlib:图表的基本构成及部件


As shown below:

Glossary of objects in a Matplotlib figure

Figure:

  • A figure is the whole plotting area that contains all plot elements. Multiple subplots may be tiled in grid within one figure.

Subplot:

  • A subplot is a subregion in a figure that contains all of the relevant data to be displayed on the same axes.

Axis:

  • An axis measures the value of a point at a certain position. Most plots contain two axes, x (horizontal) and y (vertical). Sometimes, multiple axes, each containing one data series, can be overlaid in the same plotting area of a 2D plot. You can also plot a 3D graph using a Matplotlib toolkit package, where the z axis will be specified.

Axes:

  • In Matplotlib, the keyword in plural, axes, refers to the combination of axes in a plot. This can be intuitively understood as the data plotting area, as shown in the preceding figure.

Tip: Be careful not to confuse axes and axis. While we usually refer to lines where ticks lie on as "axes," in Matplotlib, the plural axes and the singular axis specifically refer to the plotting area and the lines, respectively.

Spine:

  • Spines are the four lines that denote the boundaries of the data area.

Grid:

  • Grids are lines inside the data area that aid the reading of values.

Title:

  • A name of the figure that describes the figure clearly and succinctly.

Axis labels:

  • A word description of each axis. Units should be given if applicable.

Ticks:

  • Ticks are marks of division on a plot axis. We can add major ticks and minor ticks to a figure.

Tick labels:

  • Both major and minor ticks can be labeled. Besides printing the input data values directly, there are also formatters specific for date, logarithmic scale, and so on. We can also use our own defined functions to format the labels.

Legend:

  • A legend has labels of each data series. It usually appears as a box that matches the styles of a data series with the corresponding names.

Patches(Shapes):

  • Different shapes can be added by matplotlib.patches, including rectangles, circles, ellipses, rings, sectors, arrows, wedges, and polygons.
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 12,180评论 0 10
  • 首次海钓到黄骅 挂上沙蚕拍几下 梭鱼鲈鱼海鲶鱼 海螺海虾海螃蟹 随着潮汐齐出现 钓者赶海乐开怀
    踏雪无痕_何阅读 1,310评论 0 0
  • 百日营快过去一个月啦,在这一个月里除了每周的大课和周末分享,每日陪伴试的成长、习惯的养成和不一样的三十一天,每位小...
    Connie小明同学阅读 1,153评论 0 0
  • 雨落阶前,迎风扑面桂花香。雷声阵阵诉与谁?闲手折落桂花枝。无声。
    飞鱼kiwi阅读 984评论 0 1

友情链接更多精彩内容