python matplotlib Text类(设置绘制文本的各项属性)

from matplotlib\text.py

@cbook._define_aliases({
    "color": ["c"],
    "fontfamily": ["family"],
    "fontproperties": ["font_properties"],
    "horizontalalignment": ["ha"],
    "multialignment": ["ma"],
    "fontname": ["name"],
    "fontsize": ["size"],
    "fontstretch": ["stretch"],
    "fontstyle": ["style"],
    "fontvariant": ["variant"],
    "verticalalignment": ["va"],
    "fontweight": ["weight"],
})
class Text(Artist):
    """Handle storing and drawing of text in window or data coordinates."""
    在窗口或数据坐标中处理文本的存储和绘制

    zorder = 3
    _cached = cbook.maxdict(50)

    def __repr__(self):
        return "Text(%s, %s, %s)" % (self._x, self._y, repr(self._text))

    def __init__(self,
                 x=0, y=0, text='',
                 color=None,           # defaults to rc params
                 verticalalignment='baseline',
                 horizontalalignment='left',
                 multialignment=None,
                 fontproperties=None,  # defaults to FontProperties()
                 rotation=None,
                 linespacing=None,
                 rotation_mode=None,
                 usetex=None,          # defaults to rcParams['text.usetex']
                 wrap=False,
                 **kwargs
                 ):
        """
        Create a `.Text` instance at *x*, *y* with string *text*.

        Valid kwargs are
        %(Text)s
        """

        Artist.__init__(self)
        self._x, self._y = x, y

        if color is None:
            color = rcParams['text.color']
        if fontproperties is None:
            fontproperties = FontProperties()
        elif isinstance(fontproperties, str):
            fontproperties = FontProperties(fontproperties)

        self._text = ''
        self.set_text(text)
        self.set_color(color)
        self.set_usetex(usetex)
        self.set_wrap(wrap)
        self.set_verticalalignment(verticalalignment)
        self.set_horizontalalignment(horizontalalignment)
        self._multialignment = multialignment
        self._rotation = rotation
        self._fontproperties = fontproperties
        self._bbox_patch = None  # a FancyBboxPatch instance
        self._renderer = None
        if linespacing is None:
            linespacing = 1.2   # Maybe use rcParam later.
        self._linespacing = linespacing
        self.set_rotation_mode(rotation_mode)
        self.update(kwargs)

参考文章:matplotlib.pyplot.text()结构及用法||参数详解

参数详解

  • x, y : scalars 防止text的位置

  • s : str 内容text

  • fontdict : dictionary, optional, default: None 一个定义s格式的dict

  • withdash : boolean, optional, default: False。如果True则创建一个 TextWithDash实例。

以下为其他常用参数1:

  • fontsize设置字体大小,默认12,可选参数 [‘xx-small’, ‘x-small’, ‘small’, ‘medium’, ‘large’,‘x-large’, ‘xx-large’]

fontweight设置字体粗细,可选参数 [‘light’, ‘normal’, ‘medium’, ‘semibold’, ‘bold’, ‘heavy’, ‘black’]

  • fontstyle设置字体类型,可选参数[ ‘normal’ | ‘italic’ | ‘oblique’ ],italic斜体,oblique倾斜

  • verticalalignment设置水平对齐方式 ,可选参数 : ‘center’ , ‘top’ , ‘bottom’ ,‘baseline’

  • horizontalalignment设置垂直对齐方式,可选参数:left,right,center

  • rotation(旋转角度)可选参数为:vertical,horizontal 也可以为数字

  • alpha透明度,参数值0至1之间

  • backgroundcolor标题背景颜色

  • bbox给标题增加外框 ,常用参数如下:

  • boxstyle方框外形

  • facecolor(简写fc)背景颜色

  • edgecolor(简写ec)边框线条颜色

  • edgewidth边框线条大小

  • 2
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 5
    评论
Matplotlib Release 1.2.0 I User’s Guide 1 1 Introduction 3 2 Installing 5 2.1 Manually installing pre-built packages. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.2 Installing from source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 2.3 Build requirements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2.4 Building on OSX. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 3 Pyplot tutorial 9 3.1 Controlling line properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 3.2 Working with multiple figures and axes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 3.3 Working with text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 4 Interactive navigation 19 4.1 Navigation Keyboard Shortcuts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 5 Customizing matplotlib 23 5.1 Thematplotlibrcfile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 5.2 Dynamic rc settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 6 Using matplotlib in a python shell 33 6.1 Ipython to the rescue. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 6.2 Other python interpreters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 6.3 Controlling interactive updating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 7 Working with text 37 7.1 Text introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 7.2 Basic text commands. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 7.3 Text properties and layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 7.4 Writing mathematical expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 7.5 Typesetting With XeLaTeX/LuaLaTeX . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 7.6 Text rendering With LaTeX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 7.7 Annotating text. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 8 Image tutorial 67 8.1 Startup commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 8.2 Importing image data into Numpy arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 8.3 Plotting numpy arrays as images. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 9 Artist tutorial 81 9.1 Customizing your objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 9.2 Object containers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 9.3 Figure container . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 9.4 Axes container . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 9.5 Axis containers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 9.6 Tick containers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 10 Customizing Location of Subplot Using GridSpec 95 10.1 Basic Example of using subplot2grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 10.2 GridSpec and SubplotSpec. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 10.3 Adjust GridSpec layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 10.4 GridSpec using SubplotSpec. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 10.5 A Complex Nested GridSpec using SubplotSpec . . . . . . . . . . . . . . . . . . . . . . . 99 10.6 GridSpec with Varying Cell Sizes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 11 Tight Layout guide 103 11.1 Simple Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 12 Legend guide 119 12.1 What to be displayed. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 12.2 Multicolumn Legend. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 12.3 Legend location . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 12.4 Multiple Legend . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 12.5 Legend of Complex Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 13 Event handling and picking 127 13.1 Event connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 13.2 Event attributes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 13.3 Mouse enter and leave . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 13.4 Object picking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 14 Transformations Tutorial 137 14.1 Data coordinates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 14.2 Axes coordinates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 14.3 Blended transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 14.4 Using oset transforms to create a shadow eect . . . . . . . . . . . . . . . . . . . . . . . 144 14.5 The transformation pipeline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 15 Path Tutorial 149 15.1 Bézier example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 15.2 Compound paths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152 16 Annotating Axes 155 16.1 Annotating with Text with Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 16.2 Annotating with Arrow. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157 16.3 Placing Artist at the anchored location of the Axes . . . . . . . . . . . . . . . . . . . . . . 162 16.4 Using Complex Coordinate with Annotation . . . . . . . . . . . . . . . . . . . . . . . . . 164 16.5 Using ConnectorPatch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167 16.6 Zoom eect between Axes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168 16.7 Define Custom BoxStyle. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168 17 Our Favorite Recipes 173 17.1 Sharing axis limits and views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 17.2 Easily creating subplots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 17.3 Fixing common date annoyances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 17.4 Fill Between and Alpha . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176 17.5 Transparent, fancy legends. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180 17.6 Placing text boxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181 18 Screenshots 183 18.1 Simple Plot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183 18.2 Subplot demo. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184 18.3 Histograms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184 18.4 Path demo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185 18.5 mplot3d. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186 18.6 Ellipses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187 18.7 Bar charts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188 18.8 Pie charts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189 18.9 Table demo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190 18.10 Scatter demo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191 18.11 Slider demo. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192 18.12 Fill demo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193 18.13 Date demo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194 18.14 Financial charts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195 18.15 Basemap demo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196 18.16 Log plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197 18.17 Polar plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198 18.18 Legends. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199 18.19 Mathtext_examples. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200 18.20 Native TeX rendering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202 18.21 EEG demo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202 19 What’s new in matplotlib 205 19.1 new in matplotlib-1.2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 19.2 new in matplotlib-1.1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217 19.3 new in matplotlib-1.0. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224 19.4 new in matplotlib-0.99 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229 19.5 new in 0.98.4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232 20 Github stats 241 iii 21 License 255 21.1 License agreement for matplotlib 1.2.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255 22 Credits 257 II The Matplotlib FAQ 261 23 Installation 263 23.1 Report a compilation problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263 23.2 matplotlib compiled fine, but nothing shows up when I use it. . . . . . . . . . . . . . . . . 263 23.3 How to completely remove matplotlib. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264 23.4 How to Install . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265 23.5 Linux Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266 23.6 OS-X Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266 23.7 Windows Notes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268 24 Usage 269 24.1 General Concepts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269 24.2 Matplotlib, pylab, and pyplot: how are they related? . . . . . . . . . . . . . . . . . . . . . 270 24.3 Coding Styles. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270 24.4 What is a backend?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271 24.5 What is interactive mode? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273 25 How-To 277 25.1 Plotting: howto. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278 25.2 Contributing: howto . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288 25.3 Matplotlib in a web application server. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289 25.4 Search examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290 25.5 Cite Matplotlib . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290 26 Troubleshooting 293 26.1 Obtaining matplotlib version. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293 26.2 matplotlibinstall location . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293 26.3 .matplotlibdirectory location. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293 26.4 Getting help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294 26.5 Problems with recent git versions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295 27 Environment Variables 297 27.1 Setting environment variables in Linux and OS-X. . . . . . . . . . . . . . . . . . . . . . . 297 27.2 Setting environment variables in windows. . . . . . . . . . . . . . . . . . . . . . . . . . . 298 III The Matplotlib Developers’ Guide 299 28 Coding guide 301 28.1 Committing changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301 28.2 Style guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301 28.3 Documentation and docstrings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304 iv 28.4 Developing a new backend. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305 28.5 Writing examples. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306 28.6 Writing a new pyplot function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306 28.7 Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306 28.8 Licenses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309 29 Working withmatplotlibsource code 311 29.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311 29.2 Install git . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311 29.3 Following the latest source. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312 29.4 Making a patch. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312 29.5 Git for development . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314 29.6 git resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324 30 Documenting matplotlib 327 30.1 Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327 30.2 Organization of matplotlib’s documentation. . . . . . . . . . . . . . . . . . . . . . . . . . 327 30.3 Formatting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328 30.4 Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330 30.5 Referring to mpl documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333 30.6 Internal section references . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334 30.7 Section names, etc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334 30.8 Inheritance diagrams. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334 30.9 Emacs helpers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335 31 Doing a matplolib release 337 31.1 Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337 31.2 Branching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337 31.3 Packaging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338 31.4 Release candidate testing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338 31.5 Announcing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338 32 Working with transformations 339 32.1 matplotlib.transforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339 33 Adding new scales and projections to matplotlib 361 33.1 Creating a new scale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361 33.2 Creating a new projection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362 33.3 API documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363 34 Docs outline 373 34.1 Reviewer notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376 IV Matplotlib AxesGrid Toolkit 379 35 Overview of AxesGrid toolkit 383 35.1 What is AxesGrid toolkit? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383 35.2 AXES_GRID1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385 v 35.3 AXISARTIST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399 36 The Matplotlib AxesGrid Toolkit User’s Guide 405 36.1 AxesDivider . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405 36.2 AXISARTIST namespace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408 37 The Matplotlib AxesGrid Toolkit API 421 37.1 mpl_toolkits.axes_grid.axes_size. . . . . . . . . . . . . . . . . . . . . . . . . . . 421 37.2 mpl_toolkits.axes_grid.axes_divider. . . . . . . . . . . . . . . . . . . . . . . . . 422 37.3 mpl_toolkits.axes_grid.axes_grid. . . . . . . . . . . . . . . . . . . . . . . . . . . 425 37.4 mpl_toolkits.axes_grid.axis_artist . . . . . . . . . . . . . . . . . . . . . . . . . 426 V mplot3d 431 38 Matplotlib mplot3d toolkit 433 38.1 mplot3d tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434 38.2 mplot3d API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452 38.3 mplot3d FAQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475 VI Toolkits 477 39 Basemap 481 40 GTK Tools 483 41 Excel Tools 485 42 Natgrid 487 43 mplot3d 489 44 AxesGrid 491 VII The Matplotlib API 493 45 Plotting commands summary 495 46 API Changes 503 46.1 Changes in 1.2.x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503 46.2 Changes in 1.1.x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505 46.3 Changes beyond 0.99.x. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 506 46.4 Changes in 0.99 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507 46.5 Changes for 0.98.x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 508 46.6 Changes for 0.98.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 509 46.7 Changes for 0.98.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 509 46.8 Changes for 0.91.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514 46.9 Changes for 0.91.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514 vi 46.10 Changes for 0.91.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514 46.11 Changes for 0.90.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515 46.12 Changes for 0.90.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516 46.13 Changes for 0.87.7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517 46.14 Changes for 0.86 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519 46.15 Changes for 0.85 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519 46.16 Changes for 0.84 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 520 46.17 Changes for 0.83 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 520 46.18 Changes for 0.82 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521 46.19 Changes for 0.81 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 522 46.20 Changes for 0.80 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523 46.21 Changes for 0.73 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523 46.22 Changes for 0.72 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523 46.23 Changes for 0.71 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524 46.24 Changes for 0.70 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524 46.25 Changes for 0.65.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 525 46.26 Changes for 0.65 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 525 46.27 Changes for 0.63 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 525 46.28 Changes for 0.61 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 526 46.29 Changes for 0.60 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 526 46.30 Changes for 0.54.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 526 46.31 Changes for 0.54 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527 46.32 Changes for 0.50 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 530 46.33 Changes for 0.42 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531 46.34 Changes for 0.40 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 532 47 configuration 535 47.1 matplotlib . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535 48 afm (Adobe Font Metrics interface) 539 48.1 matplotlib.afm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539 49 animation 543 49.1 matplotlib.animation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543 50 artists 549 50.1 matplotlib.artist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549 50.2 matplotlib.lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 559 50.3 matplotlib.patches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 568 50.4 matplotlib.text. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 605 51 axes 617 51.1 matplotlib.axes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 617 52 axis 789 52.1 matplotlib.axis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 789 53 backends 799 53.1 matplotlib.backend_bases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 799 vii 53.2 matplotlib.backends.backend_gtkagg . . . . . . . . . . . . . . . . . . . . . . . . . 817 53.3 matplotlib.backends.backend_qt4agg . . . . . . . . . . . . . . . . . . . . . . . . . 818 53.4 matplotlib.backends.backend_wxagg . . . . . . . . . . . . . . . . . . . . . . . . . . 818 53.5 matplotlib.backends.backend_pdf . . . . . . . . . . . . . . . . . . . . . . . . . . . 819 53.6 matplotlib.dviread . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 822 53.7 matplotlib.type1font . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 824 54 cbook 827 54.1 matplotlib.cbook . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 827 55 cm (colormap) 837 55.1 matplotlib.cm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 837 56 collections 841 56.1 matplotlib.collections. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 841 57 colorbar 855 57.1 matplotlib.colorbar. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 855 58 colors 859 58.1 matplotlib.colors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 859 59 dates 867 59.1 matplotlib.dates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 867 60 figure 875 60.1 matplotlib.figure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 875 61 font_manager 895 61.1 matplotlib.font_manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 895 61.2 matplotlib.fontconfig_pattern. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 900 62 gridspec 903 62.1 matplotlib.gridspec. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 903 63 legend 907 63.1 matplotlib.legend . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 907 64 mathtext 911 64.1 matplotlib.mathtext. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 913 65 mlab 927 65.1 matplotlib.mlab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 927 66 nxutils 951 66.1 matplotlib.nxutils . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 951 67 path 953 67.1 matplotlib.path. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 953 viii 68 pyplot 959 68.1 matplotlib.pyplot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 959 69 sankey 1137 69.1 matplotlib.sankey . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1137 70 spines 1145 70.1 matplotlib.spines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1145 71 ticker 1149 71.1 matplotlib.ticker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1149 72 tight_layout 1157 72.1 matplotlib.tight_layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1157 73 units 1159 73.1 matplotlib.units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1159 74 widgets 1161 74.1 matplotlib.widgets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1161 VIII Glossary 1171 Python Module Index 1175 Index 1177
【优质项目推荐】 1、项目代码均经过严格本地测试,运行OK,确保功能稳定后才上传平台。可放心下载并立即投入使用,若遇到任何使用问题,随时欢迎私信反馈与沟通,博主会第一时间回复。 2、项目适用于计算机相关专业(如计科、信息安全、数据科学、人工智能、通信、物联网、自动化、电子信息等)的在校学生、专业教师,或企业员工,小白入门等都适用。 3、该项目不仅具有很高的学习借鉴价值,对于初学者来说,也是入门进阶的绝佳选择;当然也可以直接用于 毕设、课设、期末大作业或项目初期立项演示等。 3、开放创新:如果您有一定基础,且热爱探索钻研,可以在此代码基础上二次开发,进行修改、扩展,创造出属于自己的独特应用。 欢迎下载使用优质资源!欢迎借鉴使用,并欢迎学习交流,共同探索编程的无穷魅力! 基于业务逻辑生成特征变量python实现源码+数据集+超详细注释.zip基于业务逻辑生成特征变量python实现源码+数据集+超详细注释.zip基于业务逻辑生成特征变量python实现源码+数据集+超详细注释.zip基于业务逻辑生成特征变量python实现源码+数据集+超详细注释.zip基于业务逻辑生成特征变量python实现源码+数据集+超详细注释.zip基于业务逻辑生成特征变量python实现源码+数据集+超详细注释.zip基于业务逻辑生成特征变量python实现源码+数据集+超详细注释.zip 基于业务逻辑生成特征变量python实现源码+数据集+超详细注释.zip 基于业务逻辑生成特征变量python实现源码+数据集+超详细注释.zip
提供的源码资源涵盖了安卓应用、小程序、Python应用和Java应用等多个领域,每个领域都包含了丰富的实例和项目。这些源码都是基于各自平台的最新技术和标准编写,确保了在对应环境下能够无缝运行。同时,源码中配备了详细的注释和文档,帮助用户快速理解代码结构和实现逻辑。 适用人群: 这些源码资源特别适合大学生群体。无论你是计算机相关专业的学生,还是对其他领域编程感兴趣的学生,这些资源都能为你提供宝贵的学习和实践机会。通过学习和运行这些源码,你可以掌握各平台开发的基础知识,提升编程能力和项目实战经验。 使用场景及目标: 在学习阶段,你可以利用这些源码资源进行课程实践、课外项目或毕业设计。通过分析和运行源码,你将深入了解各平台开发的技术细节和最佳实践,逐步培养起自己的项目开发和问题解决能力。此外,在求职或创业过程中,具备跨平台开发能力的大学生将更具竞争力。 其他说明: 为了确保源码资源的可运行性和易用性,特别注意了以下几点:首先,每份源码都提供了详细的运行环境和依赖说明,确保用户能够轻松搭建起开发环境;其次,源码中的注释和文档都非常完善,方便用户快速上手和理解代码;最后,我会定期更新这些源码资源,以适应各平台技术的最新发展和市场需求。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Dontla

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值