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

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

各种图例:(可以在不知道想要功能的基类时在这里面找):https://matplotlib.org/gallery/index.html

 

未分类:

get_xticklabels()返回一个text object的list,可以参考text object的属性来设置想要的功能

  text:https://matplotlib.org/3.1.1/api/text_api.html#matplotlib.text.Text

 

设置label的offset的:class matplotlib.text.Text   的 horizontalalignment 属性:

  参考链接:https://matplotlib.org/3.1.1/api/text_api.html#matplotlib.text.Text

legend:图例

  参考链接:https://matplotlib.org/users/legend_guide.html(未看完)

  基础链接:https://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.figlegend(未看完)

  里面有怎么为plot添加图例的,包括位置、颜色、形状和label说明

 

知道base class的

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

  就是坐标轴了:

  参考链接:https://matplotlib.org/3.1.1/api/axis_api.html?highlight=label%20offset#id17(有很多内置类和方法)

  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

  The projection type of the subplot (Axes)

  管理一组可供系统调用的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()不会

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

转载于:https://www.cnblogs.com/Gaoqiking/p/11273323.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值