You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/users/annotations.rst
+1-3Lines changed: 1 addition & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -78,6 +78,4 @@ keyword args like ``horizontalalignment``, ``verticalalignment`` and
78
78
.. plot:: pyplots/annotation_polar.py
79
79
:include-source:
80
80
81
-
See the `annotations demo
82
-
<http://matplotlib.sf.net/examples/pylab_examples/annotation_demo.py>`_ for more
83
-
examples.
81
+
For more on all the wild and wonderful things you can do with annotations, including fancy arrows, see :ref:`plotting-guide-annotation` and :ref:`pylab_examples-annotation_demo`.
(:class:`~matplotlib.axis.Axis`, :class:`~matplotlib.axes.Axes` and
29
-
:class:`~matplotlib.figure.Figure`). The standard use is to create a
30
-
:class:`~matplotlib.figure.Figure` instance, use the ``Figure`` to
31
-
create one or more :class:`~matplotlib.axes.Axes` or
32
-
:class:`~matplotlib.axes.Subplot` instances, and use the ``Axes``
33
-
instance helper methods to create the primitives. In the example
34
-
below, we create a ``Figure`` instance using
35
-
:func:`matplotlib.pyplot.figure`, which is a convenience method for
36
-
instantiating ``Figure`` instances and connecting them with your user
37
-
interface or drawing toolkit ``FigureCanvas``. As we will discuss
38
-
below, this is not necessary, and you can work directly with
39
-
PostScript, PDF Gtk+, or wxPython ``FigureCanvas`` instances. For
40
-
example, instantiate your ``Figures`` directly and connect them
41
-
yourselves, but since we are focusing here on the ``Artist`` API we'll let
42
-
:mod:`~matplotlib.pyplot` handle some of those details for us::
22
+
There are two types of ``Artists``: primitives and containers. The primitives represent the standard graphical objects we want to paint onto our canvas: :class:`~matplotlib.lines.Line2D`, :class:`~matplotlib.patches.Rectangle`, :class:`~matplotlib.text.Text`, :class:`~matplotlib.image.AxesImage`, etc., and the containers are places to put them (:class:`~matplotlib.axis.Axis`, :class:`~matplotlib.axes.Axes` and :class:`~matplotlib.figure.Figure`). The standard use is to create a :class:`~matplotlib.figure.Figure` instance, use the ``Figure`` to create one or more :class:`~matplotlib.axes.Axes` or :class:`~matplotlib.axes.Subplot` instances, and use the ``Axes`` instance helper methods to create the primitives. In the example below, we create a ``Figure`` instance using :func:`matplotlib.pyplot.figure`, which is a convenience method for instantiating ``Figure`` instances and connecting them with your user interface or drawing toolkit ``FigureCanvas``. As we will discuss below, this is not necessary -- you can work directly with PostScript, PDF Gtk+, or wxPython ``FigureCanvas`` instances, instantiate your ``Figures`` directly and connect them yourselves -- but since we are focusing here on the ``Artist`` API we'll let :mod:`~matplotlib.pyplot` handle some of those details for us::
43
23
44
24
import matplotlib.pyplot as plt
45
25
fig = plt.figure()
@@ -85,7 +65,7 @@ subclass of ``Axes``) and when you call ``ax.plot``, it creates a
85
65
<matplotlib.axes.Axes.lines>` list. In the interactive `ipython
86
66
<http://ipython.scipy.org/>`_ session below, you can see that the
87
67
``Axes.lines`` list is length one and contains the same line that was
88
-
returned by the ``line, = ax.plot(x, y, 'o')`` call:
68
+
returned by the ``line, = ax.plot...`` call:
89
69
90
70
.. sourcecode:: ipython
91
71
@@ -536,20 +516,7 @@ and zooming, as well as the :class:`~matplotlib.ticker.Locator` and
536
516
:class:`~matplotlib.ticker.Formatter` instances which control where
537
517
the ticks are placed and how they are represented as strings.
538
518
539
-
Each ``Axis`` object contains a :attr:`~matplotlib.axis.Axis.label`
540
-
attribute (this is what the :mod:`~matplotlib.pylab` calls to
541
-
:func:`~matplotlib.pylab.xlabel` and :func:`~matplotlib.pylab.ylabel`
542
-
set) as well as a list of major and minor ticks. The ticks are
543
-
:class:`~matplotlib.axis.XTick` and :class:`~matplotlib.axis.YTick`
544
-
instances, which contain the actual line and text primitives that
545
-
render the ticks and ticklabels. Because the ticks are dynamically
546
-
created as needed (eg. when panning and zooming), you should access
547
-
the lists of major and minor ticks through their accessor methods
548
-
:meth:`~matplotlib.axis.Axis.get_major_ticks` and
549
-
:meth:`~matplotlib.axis.Axis.get_minor_ticks`. Although the ticks
550
-
contain all the primitives and will be covered below, the ``Axis`` methods
551
-
contain accessor methods to return the tick lines, tick labels, tick
552
-
locations etc.:
519
+
Each ``Axis`` object contains a :attr:`~matplotlib.axis.Axis.label` attribute (this is what :mod:`~matplotlib.pylab` modifies in calls to :func:`~matplotlib.pylab.xlabel` and :func:`~matplotlib.pylab.ylabel`) as well as a list of major and minor ticks. The ticks are :class:`~matplotlib.axis.XTick` and :class:`~matplotlib.axis.YTick` instances, which contain the actual line and text primitives that render the ticks and ticklabels. Because the ticks are dynamically created as needed (eg. when panning and zooming), you should access the lists of major and minor ticks through their accessor methods :meth:`~matplotlib.axis.Axis.get_major_ticks` and :meth:`~matplotlib.axis.Axis.get_minor_ticks`. Although the ticks contain all the primitives and will be covered below, the ``Axis`` methods contain accessor methods to return the tick lines, tick labels, tick locations etc.:
553
520
554
521
.. sourcecode:: ipython
555
522
@@ -636,7 +603,7 @@ label1On boolean which determines whether to draw tick label
636
603
label2On boolean which determines whether to draw tick label
0 commit comments