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

Skip to content

Commit cc85fb6

Browse files
authored
Merge pull request #24715 from timhoffm/doc-axes-creation
Add note that users do not instantiate Axes directly
2 parents 58de4e2 + de8d265 commit cc85fb6

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ class Axes(_AxesBase):
5555
are 'xlim_changed' and 'ylim_changed' and the callback will be called with
5656
func(*ax*) where *ax* is the `Axes` instance.
5757
58+
.. note::
59+
60+
As a user, you do not instantiate Axes directly, but use Axes creation
61+
methods instead; e.g. from `.pyplot` or `.Figure`:
62+
`~.pyplot.subplots`, `~.pyplot.subplot_mosaic` or `.Figure.add_axes`.
63+
5864
Attributes
5965
----------
6066
dataLim : `.Bbox`

lib/mpl_toolkits/mplot3d/axes3d.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@
4545
class Axes3D(Axes):
4646
"""
4747
3D Axes object.
48+
49+
.. note::
50+
51+
As a user, you do not instantiate Axes directly, but use Axes creation
52+
methods instead; e.g. from `.pyplot` or `.Figure`:
53+
`~.pyplot.subplots`, `~.pyplot.subplot_mosaic` or `.Figure.add_axes`.
4854
"""
4955
name = '3d'
5056

tutorials/toolkits/mplot3d.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@
2424
:target: ../../gallery/mplot3d/subplot3d.html
2525
:align: center
2626
27-
.. versionchanged:: 1.0.0
28-
Prior to Matplotlib 1.0.0, only a single `.Axes3D` could be created per
29-
figure; it needed to be directly instantiated as ``ax = Axes3D(fig)``.
30-
3127
.. versionchanged:: 3.2.0
3228
Prior to Matplotlib 3.2.0, it was necessary to explicitly import the
3329
:mod:`mpl_toolkits.mplot3d` module to make the '3d' projection to

0 commit comments

Comments
 (0)