Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 61518eb

Browse files
committed
Adding cross-references.
svn path=/trunk/matplotlib/; revision=5229
1 parent ffe49ba commit 61518eb

1 file changed

Lines changed: 22 additions & 19 deletions

File tree

doc/users_guide/add_new_projection.txt

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ that handle data in two or more dimensions at a time, are called
1414
"projections".
1515

1616
From the user's perspective, the scale of a plot can be set with
17-
``set_xscale()`` and ``set_yscale()``. Projections can be chosen using
18-
the ``projection`` keyword argument to the ``plot()`` or ``subplot()``
19-
functions::
17+
:meth:`~matplotlib.axes.Axes.set_xscale` and
18+
:meth:`~matplotlib.axes.Axes.set_xscale`. Projections can be chosen
19+
using the ``projection`` keyword argument to the
20+
:func:`~matplotlib.pylab.plot` or :func:`~matplotlib.pylab.subplot`
21+
functions, e.g.::
2022

2123
plot(x, y, projection="custom")
2224

@@ -30,8 +32,8 @@ tree itself.
3032
Creating a new scale
3133
====================
3234

33-
Adding a new scale consists of defining a subclass of ``ScaleBase``
34-
(in the ``matplotlib.scale`` module), that includes the following
35+
Adding a new scale consists of defining a subclass of
36+
:class:`matplotlib.scale.ScaleBase`, that includes the following
3537
elements:
3638

3739
- A transformation from data coordinates into display coordinates.
@@ -53,20 +55,19 @@ elements:
5355
- Formatters (major and minor) that specify how the tick labels
5456
should be drawn.
5557

56-
Once the class is defined, it must be registered with ``matplotlib``
57-
so that the user can select it.
58+
Once the class is defined, it must be registered with matplotlib so
59+
that the user can select it.
5860

5961
A full-fledged and heavily annotated example is in
60-
``examples/custom_scale_example.py``. There are also some ``Scale``
61-
classes in ``scale.py`` that may be used as starting points.
62+
:file:`examples/api/custom_scale_example.py`. There are also some classes
63+
in :mod:`matplotlib.scale` that may be used as starting points.
6264

6365

6466
Creating a new projection
6567
=========================
6668

67-
Adding a new projection consists of defining a subclass of ``Axes``
68-
(in the ``matplotlib.axes`` module), that includes the following
69-
elements:
69+
Adding a new projection consists of defining a subclass of
70+
:class:`matplotlib.axes.Axes`, that includes the following elements:
7071

7172
- A transformation from data coordinates into display coordinates.
7273

@@ -75,10 +76,11 @@ elements:
7576

7677
- Transformations for the gridlines, ticks and ticklabels. Custom
7778
projections will often need to place these elements in special
78-
locations, and ``matplotlib`` has a facility to help with doing so.
79+
locations, and matplotlib has a facility to help with doing so.
7980

80-
- Setting up default values (overriding ``cla()``), since the
81-
defaults for a rectilinear axes may not be appropriate.
81+
- Setting up default values (overriding
82+
:meth:`~matplotlib.axes.Axes.cla`), since the defaults for a
83+
rectilinear axes may not be appropriate.
8284

8385
- Defining the shape of the axes, for example, an elliptical axes,
8486
that will be used to draw the background of the plot and for
@@ -90,13 +92,14 @@ elements:
9092

9193
- Set up interactive panning and zooming. This is left as an
9294
"advanced" feature left to the reader, but there is an example of
93-
this for polar plots in ``polar.py``.
95+
this for polar plots in :mod:`matplotlib.projections.polar`.
9496

9597
- Any additional methods for additional convenience or features.
9698

97-
Once the class is defined, it must be registered with ``matplotlib``
99+
Once the class is defined, it must be registered with matplotlib
98100
so that the user can select it.
99101

100102
A full-fledged and heavily annotated example is in
101-
``examples/custom_projection_example.py``. The polar plot
102-
functionality in ``polar.py`` may also be of interest.
103+
:file:`examples/api/custom_projection_example.py`. The polar plot
104+
functionality in :mod:`matplotlib.projections.polar` may also be of
105+
interest.

0 commit comments

Comments
 (0)