Matplotlib Archiecture

matplotlib架构分为脚本层、艺术家层和后端层。脚本层面向用户,简化了与后端和艺术家层的交互,提供了如plot()、title()等函数。艺术家层包括线条、形状、坐标轴等,容器类如Figure、Axes。后端层负责不同用户和输出格式,分为用户界面后端和硬拷贝后端,如GTKAgg、WXAgg等。
摘要由CSDN通过智能技术生成

前言:
matplotlib使用matplotlibrc配置文件自定义各种属性,我们称之为rc设置或rc参数。你可以控制matplotlib中几乎所有属性的默认值:图形大小和dpi、线宽、颜色和样式、轴、轴和网格属性、文本和字体属性等等
the creators of matplotlib were originally focused on building a GTK+ application for researchers and providing
a command interface for the interactive plotting of data, not unlike that provided by MATLAB.
创作Matplotlib的初衷就是为研究开发者建立一个GTK+的应用,提供一个命令的接口用来交互的绘制数据。
架构分为三层

  • Scripting Layer
  • Artist Layer
  • Backend Layer

Scrpting Layer

在这里插入图片描述
背景:虽然后端层着重于提供公共的接口,并渲染呈现艺术层的图元和容器,但是脚本层是面向用户的接口,它简化了与其他层一起工作的任务,将后端和艺术层的很多功能包装起来,形成两类包装类型:

  • 后端包装器
    1. Module
    2. Draw
    3. Factory
    4. Mainloop
  • 艺术层包装类型
    1. Figure
    2. Axes
    3. Plot
    4. Hold

当导入pyplot库之后,它会为系统选择默认的后端,或者之前你配置的后端。
在选择完后端之后,它就要调用一系列的初始化函数:

  1. Creates a figure manager factory function, which when called will create a new figure manager appropriate for the selected backend:创建一个图片管理工厂函数
  2. Prepares the drawing function that should be used with the selected backend (taking into account whether the backend is a hardcopy or a user interface):
    为选择的后端准备一个绘制函数
  3. Identifies the callable function that integrates with the backend mainloop function:
    标识与后端主循环函数集成的可调用函数
  4. Provides the module for the selected backend:为选择的后端提供模块

The py

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值