8000 Improved api_changes documentation. · matplotlib/matplotlib@ea9a5b3 · GitHub
[go: up one dir, main page]

Skip to content

Commit ea9a5b3

Browse files
committed
Improved api_changes documentation.
1 parent 3a4241c commit ea9a5b3

File tree

1 file changed

+27
-8
lines changed

1 file changed

+27
-8
lines changed

doc/api/api_changes.rst

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,35 @@ Changes in 1.2.x
2222
now set the radius of the pie; setting the *radius* to 'None' (the default
2323
value), will result in a pie with a radius of 1 as before.
2424

25-
* Use of :func:`matplotlib.projections.projection_factory` is now deprecated
25+
* Use of :func:`~matplotlib.projections.projection_factory` is now deprecated
2626
in favour of axes class identification using
27-
:func:`matplotlib.projections.process_projection_requirements` followed by
28-
direct axes class invocation (at the time of writing, this is done by
29-
:meth:`matplotlib.figure.Figure.add_axes`,
30-
:meth:`matplotlib.figure.Figure.add_subplot` and
31-
:meth:`matplotlib.figure.Figure.gca`.
27+
:func:`~matplotlib.projections.process_projection_requirements` followed by
28+
direct axes class invocation (at the time of writing, functions which do this
29+
are: :meth:`~matplotlib.figure.Figure.add_axes`,
30+
:meth:`~matplotlib.figure.Figure.add_subplot` and
31+
:meth:`~matplotlib.figure.Figure.gca`). Therefore::
32+
33+
34+
key = figure._make_key(*args, **kwargs)
35+
ispolar = kwargs.pop('polar', False)
36+
projection = kwargs.pop('projection', None)
37+
if ispolar:
38+
if projection is not None and projection != 'polar':
39+
raise ValuError('polar and projection args are inconsistent')
40+
projection = 'polar'
41+
ax = projection_factory(projection, self, rect, **kwargs)
42+
key = self._make_key(*args, **kwargs)
43+
44+
# is now
45+
46+
projection_class, kwargs, key = \
47+
process_projection_requirements(self, *args, **kwargs)
48+
ax = projection_class(self, rect, **kwargs)
49+
3250
This change means that third party objects can expose themselves as
33-
matplotlib axes by providing a ``_as_mpl_axes`` method (see
34-
:ref:`adding-new-scales` for more detail).
51+
matplotlib axes by providing a ``_as_mpl_axes`` method. See
52+
:ref:`adding-new-scales` for more detail.
53+
3554

3655
Changes in 1.1.x
3756
================

0 commit comments

Comments
 (0)
0