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

Skip to content

Commit b182628

Browse files
committed
DOC: organize explain section
1 parent 651a874 commit b182628

4 files changed

Lines changed: 132 additions & 24 deletions

File tree

doc/users/explain/index.rst

Lines changed: 44 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,52 @@
22

33
.. redirect-from:: /users/explain
44

5-
Explanations
6-
------------
5+
################
6+
Using Matplotlib
7+
################
8+
9+
Creating and interacting with visualizations
10+
############################################
11+
12+
.. toctree::
13+
:maxdepth: 1
14+
15+
../../tutorials/introductory/quick_start.rst
16+
../../plot_types/index.rst
17+
Arranging and laying out axes <layout/index.rst>
18+
Customizing how Artists look <../../tutorials/introductory/customizing.rst>
19+
Working with Artist objects <../../tutorials/intermediate/artists.rst>
20+
Adding text to plots <text/index.rst>
21+
Specifying and working with colors <../../tutorials/colors/index.rst>
22+
Interacting with plots (zoom, pan, and more) <interactive.rst>
23+
Animating plots <../../tutorials/introductory/animation_tutorial.rst>
24+
Matplotlib toolkits (mplot3d, axes_grid1, axisartist) <../../tutorials/toolkits/index.rst>
25+
26+
Important concepts
27+
##################
28+
29+
.. toctree::
30+
:maxdepth: 1
31+
32+
Pyplot versus Axes interfaces <api_interfaces.rst>
33+
Backends: how plots get rendered to screen <backends.rst>
34+
Using transforms <../../tutorials/advanced/transforms_tutorial.rst>
35+
../../tutorials/intermediate/autoscale.rst
36+
../../tutorials/intermediate/color_cycle.rst
37+
../../tutorials/intermediate/imshow_extent.rst
38+
../../gallery/images_contours_and_fields/image_antialiasing.rst
39+
40+
41+
Advanced topics
42+
###############
743

844
.. toctree::
9-
:maxdepth: 2
45+
:maxdepth: 1
1046

11-
api_interfaces.rst
12-
backends.rst
1347
writing_a_backend_pyplot_interface.rst
14-
interactive.rst
15-
fonts.rst
16-
event_handling.rst
17-
performance.rst
1848
interactive_guide.rst
49+
performance.rst
50+
../../tutorials/advanced/blitting.rst
51+
event_handling.rst
52+
../../tutorials/advanced/path_tutorial.rst
53+
../../tutorials/advanced/patheffects_guide.rst

doc/users/explain/layout/index.rst

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
########################################
3+
Arranging and laying out Axes (subplots)
4+
########################################
5+
6+
.. plot::
7+
8+
import matplotlib.pyplot as plt
9+
import numpy as np
10+
11+
fig, axs = plt.subplots(ncols=2, nrows=2, figsize=(3.5, 2.5),
12+
layout="constrained")
13+
# add an artist, in this case a nice label in the middle...
14+
for row in range(2):
15+
for col in range(2):
16+
axs[row, col].annotate(f'axs[{row}, {col}]', (0.5, 0.5),
17+
transform=axs[row, col].transAxes,
18+
ha='center', va='center', fontsize=18,
19+
color='darkgrey')
20+
fig.suptitle('plt.subplots()')
21+
22+
23+
.. toctree::
24+
:maxdepth: 1
25+
26+
../../../tutorials/intermediate/arranging_axes.rst
27+
../../../gallery/subplots_axes_and_figures/colorbar_placement.rst
28+
../../../gallery/subplots_axes_and_figures/mosaic.rst
29+
../../../tutorials/intermediate/constrainedlayout_guide.rst
30+
../../../tutorials/intermediate/tight_layout_guide.rst
31+

doc/users/explain/text/index.rst

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
2+
####################
3+
Adding text to plots
4+
####################
5+
6+
.. plot::
7+
8+
import matplotlib
9+
import matplotlib.pyplot as plt
10+
11+
fig = plt.figure()
12+
ax = fig.add_subplot()
13+
fig.subplots_adjust(top=0.85)
14+
15+
# Set titles for the figure and the subplot respectively
16+
fig.suptitle('bold figure suptitle', fontsize=14, fontweight='bold')
17+
ax.set_title('axes title')
18+
19+
ax.set_xlabel('xlabel')
20+
ax.set_ylabel('ylabel')
21+
22+
# Set both x- and y-axis limits to [0, 10] instead of default [0, 1]
23+
ax.axis([0, 10, 0, 10])
24+
25+
ax.text(3, 8, 'boxed italics text in data coords', style='italic',
26+
bbox={'facecolor': 'red', 'alpha': 0.5, 'pad': 10})
27+
28+
ax.text(2, 6, r'an equation: $E=mc^2$', fontsize=15)
29+
30+
ax.text(3, 2, 'Unicode: Institut für Festkörperphysik')
31+
32+
ax.text(0.95, 0.01, 'colored text in axes coords',
33+
verticalalignment='bottom', horizontalalignment='right',
34+
transform=ax.transAxes,
35+
color='green', fontsize=15)
36+
37+
ax.plot([2], [1], 'o')
38+
ax.annotate('annotate', xy=(2, 1), xytext=(3, 4),
39+
arrowprops=dict(facecolor='black', shrink=0.05))
40+
41+
plt.show()
42+
43+
.. toctree::
44+
:maxdepth: 1
45+
46+
../../../tutorials/text/text_intro.rst
47+
../../../tutorials/intermediate/legend_guide.rst
48+
../../../tutorials/text/annotations.rst
49+
../../../tutorials/text/text_props.rst
50+
../../../tutorials/text/mathtext.rst
51+
../../../tutorials/text/usetex.rst
52+
../fonts.rst

doc/users/index.rst

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,22 @@
33
.. redirect-from:: /contents
44

55

6-
###########
7-
Users guide
8-
###########
6+
######################
7+
Matplotlib Users guide
8+
######################
99

1010
General
1111
#######
1212

1313
.. toctree::
14-
:maxdepth: 2
14+
:maxdepth: 1
1515

1616
getting_started/index.rst
1717
installing/index.rst
18-
explain/index.rst
18+
Using Matplotlib <explain/index.rst>
1919
faq/index.rst
2020
resources/index.rst
2121

22-
Tutorials and examples
23-
######################
24-
25-
.. toctree::
26-
:maxdepth: 1
27-
28-
../plot_types/index.rst
29-
../tutorials/index.rst
30-
../gallery/index.rst
31-
3222
Reference
3323
#########
3424

0 commit comments

Comments
 (0)