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

Skip to content

Commit 6a16eea

Browse files
committed
Further revisions to the mplot3d docs to include when certain features were added, a table of contents, and improved the aspect ration of the subplot figures.
1 parent 9399b2d commit 6a16eea

File tree

3 files changed

+38
-6
lines changed

3 files changed

+38
-6
lines changed

doc/mpl_toolkits/mplot3d/tutorial.rst

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
****************
55
mplot3d tutorial
66
****************
7+
.. contents::
8+
:backlinks: none
9+
10+
.. _mplot3d_getting_started:
711

812
Getting started
913
===============
@@ -26,24 +30,32 @@ add a new axes to it of type :class:`~mpl_toolkits.mplot3d.Axes3D`::
2630
``ax = fig.add_subplot(111, projection='3d')``
2731
to ``ax = Axes3D(fig)``.
2832

33+
.. _plot3d:
34+
2935
Line plots
3036
====================
3137
.. automethod:: Axes3D.plot
3238

3339
.. plot:: mpl_examples/mplot3d/lines3d_demo.py
3440

41+
.. _scatter3d:
42+
3543
Scatter plots
3644
=============
3745
.. automethod:: Axes3D.scatter
3846

3947
.. plot:: mpl_examples/mplot3d/scatter3d_demo.py
4048

49+
.. _wireframe:
50+
4151
Wireframe plots
4252
===============
4353
.. automethod:: Axes3D.plot_wireframe
4454

4555
.. plot:: mpl_examples/mplot3d/wire3d_demo.py
4656

57+
.. _surface:
58+
4759
Surface plots
4860
=============
4961
.. automethod:: Axes3D.plot_surface
@@ -52,6 +64,8 @@ Surface plots
5264
.. plot:: mpl_examples/mplot3d/surface3d_demo2.py
5365
.. plot:: mpl_examples/mplot3d/surface3d_demo3.py
5466

67+
.. _contour3d:
68+
5569
Contour plots
5670
=============
5771
.. automethod:: Axes3D.contour
@@ -60,43 +74,60 @@ Contour plots
6074
.. plot:: mpl_examples/mplot3d/contour3d_demo2.py
6175
.. plot:: mpl_examples/mplot3d/contour3d_demo3.py
6276

77+
.. _contourf3d:
78+
6379
Filled contour plots
6480
====================
6581
.. automethod:: Axes3D.contourf
6682

6783
.. plot:: mpl_examples/mplot3d/contourf3d_demo.py
6884
.. plot:: mpl_examples/mplot3d/contourf3d_demo2.py
6985

86+
.. versionadded:: 1.0.1
87+
The feature demoed in the second contourf3d example was enabled as a
88+
result of a bugfix for version 1.0.1.
89+
90+
.. _polygon3d:
91+
7092
Polygon plots
7193
====================
7294
.. automethod:: Axes3D.add_collection3d
7395

7496
.. plot:: mpl_examples/mplot3d/polys3d_demo.py
7597

98+
.. _bar3d:
99+
76100
Bar plots
77101
====================
78102
.. automethod:: Axes3D.bar
79103

80104
.. plot:: mpl_examples/mplot3d/bars3d_demo.py
81105

106+
.. _2dcollections3d:
107+
82108
2D plots in 3D
83109
====================
84110
.. plot:: mpl_examples/mplot3d/2dcollections3d_demo.py
85111

112+
.. _text3d:
113+
86114
Text
87115
====================
88116
.. automethod:: Axes3D.text
89117

90118
.. plot:: mpl_examples/mplot3d/text3d_demo.py
91119

120+
.. _3dsubplots:
121+
92122
Subplotting
93123
====================
94124
Having multiple 3d plots in a single figure is the same
95-
as it is for 2d plots. And you can mix 2d and 3d plots
96-
into the same figure.
125+
as it is for 2d plots. Also, you can have both 2d and 3d plots
126+
in the same figure.
97127

98128
.. versionadded:: 1.0.0
99-
This feature was added in v1.0.0. Earlier version can not do this.
129+
Subplotting 3d plots was added in v1.0.0. Earlier version can not
130+
do this.
100131

101132
.. plot:: mpl_examples/mplot3d/subplot3d_demo.py
102133
.. plot:: mpl_examples/mplot3d/mixed_subplots_demo.py

examples/mplot3d/mixed_subplots_demo.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ def f(t):
1818
t2 = np.arange(0.0, 5.0, 0.02)
1919
t3 = np.arange(0.0, 2.0, 0.01)
2020

21-
fig = plt.figure()
21+
# Twice as tall as it is wide.
22+
fig = plt.figure(figsize=plt.figaspect(2.))
2223
fig.suptitle('A tale of 2 subplots')
2324
ax = fig.add_subplot(2, 1, 1)
2425
l = ax.plot(t1, f(t1), 'bo',

examples/mplot3d/subplot3d_demo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
from matplotlib import cm
88
from mpl_toolkits.mplot3d.axes3d import get_test_data
99

10-
11-
fig = plt.figure(figsize=(9.5,5.0))
10+
# Twice as wide as it is tall.
11+
fig = plt.figure(figsize=plt.figaspect(0.5))
1212

1313
#---- First subplot
1414
ax = fig.add_subplot(1, 2, 1, projection='3d')

0 commit comments

Comments
 (0)