@@ -39,24 +39,23 @@ Adding a new scale consists of defining a subclass of
3939:class: `matplotlib.scale.ScaleBase `, that includes the following
4040elements:
4141
42- - A transformation from data coordinates into display coordinates.
42+ - A transformation from data coordinates into display coordinates.
4343
44- - An inverse of that transformation. This is used, for example, to
45- convert mouse positions from screen space back into data space.
44+ - An inverse of that transformation. This is used, for example, to
45+ convert mouse positions from screen space back into data space.
4646
47- - A function to limit the range of the axis to acceptable values
48- (``limit_range_for_scale() ``). A log scale, for instance, would
49- prevent the range from including values less than or equal to
50- zero.
47+ - A function to limit the range of the axis to acceptable values
48+ (``limit_range_for_scale() ``). A log scale, for instance, would
49+ prevent the range from including values less than or equal to zero.
5150
52- - Locators (major and minor) that determine where to place ticks in
53- the plot, and optionally, how to adjust the limits of the plot to
54- some "good" values. Unlike ``limit_range_for_scale() ``, which is
55- always enforced, the range setting here is only used when
56- automatically setting the range of the plot.
51+ - Locators (major and minor) that determine where to place ticks in
52+ the plot, and optionally, how to adjust the limits of the plot to
53+ some "good" values. Unlike ``limit_range_for_scale() ``, which is
54+ always enforced, the range setting here is only used when
55+ automatically setting the range of the plot.
5756
58- - Formatters (major and minor) that specify how the tick labels
59- should be drawn.
57+ - Formatters (major and minor) that specify how the tick labels
58+ should be drawn.
6059
6160Once the class is defined, it must be registered with matplotlib so
6261that the user can select it.
@@ -75,51 +74,48 @@ Adding a new projection consists of defining a projection axes which
7574subclasses :class: `matplotlib.axes.Axes ` and includes the following
7675elements:
7776
78- - A transformation from data coordinates into display coordinates.
77+ - A transformation from data coordinates into display coordinates.
7978
80- - An inverse of that transformation. This is used, for example, to
81- convert mouse positions from screen space back into data space.
79+ - An inverse of that transformation. This is used, for example, to
80+ convert mouse positions from screen space back into data space.
8281
83- - Transformations for the gridlines, ticks and ticklabels. Custom
84- projections will often need to place these elements in special
85- locations, and matplotlib has a facility to help with doing so.
82+ - Transformations for the gridlines, ticks and ticklabels. Custom
83+ projections will often need to place these elements in special
84+ locations, and matplotlib has a facility to help with doing so.
8685
87- - Setting up default values (overriding
88- :meth: `~matplotlib.axes.Axes.cla `), since the defaults for a
89- rectilinear axes may not be appropriate.
86+ - Setting up default values (overriding :meth: `~matplotlib.axes.Axes.cla `),
87+ since the defaults for a rectilinear axes may not be appropriate.
9088
91- - Defining the shape of the axes, for example, an elliptical axes,
92- that will be used to draw the background of the plot and for
93- clipping any data elements.
89+ - Defining the shape of the axes, for example, an elliptical axes, that will be
90+ used to draw the background of the plot and for clipping any data elements.
9491
95- - Defining custom locators and formatters for the projection. For
96- example, in a geographic projection, it may be more convenient to
97- display the grid in degrees, even if the data is in radians.
92+ - Defining custom locators and formatters for the projection. For
93+ example, in a geographic projection, it may be more convenient to
94+ display the grid in degrees, even if the data is in radians.
9895
99- - Set up interactive panning and zooming. This is left as an
100- "advanced" feature left to the reader, but there is an example of
101- this for polar plots in :mod: `matplotlib.projections.polar `.
96+ - Set up interactive panning and zooming. This is left as an
97+ "advanced" feature left to the reader, but there is an example of
98+ this for polar plots in :mod: `matplotlib.projections.polar `.
10299
103- - Any additional methods for additional convenience or features.
100+ - Any additional methods for additional convenience or features.
104101
105102Once the projection axes is defined, it can be used in one of two ways:
106103
107- - By defining the class attribute ``name ``, the projection axes can be
108- registered with :func: `matplotlib.projections.register_projection `
109- and subsequently simply invoked by name::
104+ - By defining the class attribute ``name ``, the projection axes can be
105+ registered with :func: `matplotlib.projections.register_projection `
106+ and subsequently simply invoked by name::
110107
111- plt.axes(projection='my_proj_name')
108+ plt.axes(projection='my_proj_name')
112109
113- - For more complex, parameterisable projections, a generic "projection"
114- object may be defined which includes the method ``_as_mpl_axes ``.
115- ``_as_mpl_axes `` should take no arguments and return the projection's
116- axes subclass and a dictionary of additional arguments to pass to the
117- subclass' ``__init__ `` method. Subsequently a parameterised projection
118- can be initialised with::
110+ - For more complex, parameterisable projections, a generic "projection" object
111+ may be defined which includes the method ``_as_mpl_axes ``. ``_as_mpl_axes ``
112+ should take no arguments and return the projection's axes subclass and a
113+ dictionary of additional arguments to pass to the subclass' ``__init__ ``
114+ method. Subsequently a parameterised projection can be initialised with::
119115
120- plt.axes(projection=MyProjection(param1=param1_value))
116+ plt.axes(projection=MyProjection(param1=param1_value))
121117
122- where MyProjection is an object which implements a ``_as_mpl_axes `` method.
118+ where MyProjection is an object which implements a ``_as_mpl_axes `` method.
123119
124120
125121A full-fledged and heavily annotated example is in
0 commit comments