Matplotlib 绘图与可视化 一些控件的介绍和属性,反正就是乱七八糟的

这个链接里有下面这个图(图里还有超链接):https://matplotlib.org/3.1.1/api/artist_api.html#matplotlib.artist.Artist

figure:

  可以理解为画板(还有一个大写的Figure)

  参考链接:https://matplotlib.org/3.1.1/api/figure_api.html?highlight=figure#module-matplotlib.figure

  是个module,提供了top-level的Artist,The Figure 包括了所有的绘制元素

  还有定义的一些子类

 

Artist class

  abstract base class for objects that render into a FigureCanvas(渲染为FigureCanvas的对象的抽象基类?#canvas:画布)

  一般情况下,figure中的所有可见元素都是Artist的子类

  参考链接:https://matplotlib.org/3.1.1/api/artist_api.html#matplotlib.artist.Artist


Figure:(也是一个类)

  The top level container for all the plot elements

  参考链接:https://matplotlib.org/3.1.1/api/_as_gen/matplotlib.figure.Figure.html#matplotlib.figure.Figure

  有回调函数和事件

  链接里有这个类的属性和参数,还有一些方法,添加Artist到figure,添加axes到figure(这种添加方式,如果如果图中已经有一个带键的轴,那么它只会使轴成为当前轴并返回它)还有别的,太长了,没看下去

 

plot:画布,

  是画板的一小部分

 

Axes

  是一个类,包括figure上的大部分figure元素:(Axis、Tick、line2D、Text、polygon...etc,)并且色泽这个坐标系,含有事件和回调函数,会在figure中建立一个axes

  参考链接:https://matplotlib.org/3.1.1/api/axes_api.html?highlight=axes#module-matplotlib.axes

  参考链接中还有subplots、plotting

Axis

  就是坐标轴了:

  secondary Axis:次要坐标轴,就是上面的和右边的轴

  参考链接:https://matplotlib.org/3.1.1/gallery/subplots_axes_and_figures/secondary_axis.html#sphx-glr-gallery-subplots-axes-and-figures-secondary-axis-py

  介绍了添加次要坐标轴的方法,举了一个例子说明

 

label

  label是坐标轴上的标签,就是tick的文字内容,一条坐标轴上可以有多个labels

  参考链接:https://matplotlib.org/3.1.1/gallery/lines_bars_and_markers/barchart.html#sphx-glr-gallery-lines-bars-and-markers-barchart-py

  旋转label文字方向的:https://matplotlib.org/3.1.1/gallery/ticks_and_spines/ticklabels_rotation.html#sphx-glr-gallery-ticks-and-spines-ticklabels-rotation-py

Tick

  是坐标轴上的标记  

  参考链接:https://matplotlib.org/3.1.1/api/ticker_api.html#module-matplotlib.ticker

  关于tick的定位和格式,太长了没看完

  matplotlib.pyplot.xticks:获取或者设置当前x轴上的tick的位置和label

  参考链接:https://matplotlib.org/3.1.1/api/_as_gen/matplotlib.pyplot.xticks.html#matplotlib.pyplot.xticks

  返回一个包含label位置的数组,一个文字对象列表

  plyplot调用(.xticks())(有参和无参)等等同与当前axes调用方法(.get_xticks()和get_xticklabels())

  还可以Set text labels and properties:

  参考链接中还包含ticks可以完成的工作,用图直观的罗列了出来

  Custom Ticker1

  参考链接:https://matplotlib.org/3.1.1/gallery/ticks_and_spines/custom_ticker1.html#sphx-glr-gallery-ticks-and-spines-custom-ticker1-py

  The new ticker code was designed to explicitly support user customized ticking.

  举了一个例子,通过一个自定义的函数,来自定义ticking

 

matplotlib.projections

  管理一组可供系统调用的projections(projection:投影)base:object

  参考链接:https://translate.google.cn/?hl=zh-CN&tab=TT#view=home&op=translate&sl=en&tl=zh-CN&text=projections

matplotlib.pyplot.subplot

  在当前figure中add a subplot,返回一个axes

  参考链接:https://matplotlib.org/3.1.1/api/_as_gen/matplotlib.pyplot.subplot.html

  和Figure.add_subplot()的不同

  前者创建一个subplot会删除 除了交叠边界 以外与其重叠的 任何已经存在的subplot,而Figure.add_subplot()不会

  后面以图片的信息展示了许多使用此种方法可以完成的图像

猜你喜欢

转载自www.cnblogs.com/Gaoqiking/p/11273323.html
今日推荐