Skip to content

Commit dcbb956

Browse files
committed
DOC: Move OO-examples from pyplot section
to corresponding sections for OO-style examples. - remove pyplot/bpyplots/boxplot_demo_pyplot.py as it's the same as the boxplot demo in statistics - remove pyplots/text_layout.py as it's a duplicate of text_alignment.py in Text, labels and annotations. - merge very basic examples pyplots/fig_axes_labels_simple.py and pyplots/pyplot_formatstr.py into pyplots/pyplot_simple.py
1 parent 7a25f50 commit dcbb956

20 files changed

+37
-224
lines changed

doc/users/faq/howto_faq.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@ behavior by specifying the coordinates of the label. The example
203203
below shows the default behavior in the left subplots, and the manual
204204
setting in the right subplots.
205205

206-
.. figure:: ../../gallery/pyplots/images/sphx_glr_align_ylabels_001.png
207-
:target: ../../gallery/pyplots/align_ylabels.html
206+
.. figure:: ../../gallery/text_labels_and_annotations/images/sphx_glr_align_ylabels_001.png
207+
:target: ../../gallery/text_labels_and_annotations/align_ylabels.html
208208
:align: center
209209
:scale: 50
210210

examples/pyplots/fig_x.py renamed to examples/misc/fig_x.py

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
=======================
55
66
Adding lines to a figure without any axes.
7+
8+
.. redirect-from:: /gallery/pyplots/fig_x
79
"""
810

911
import matplotlib.pyplot as plt

examples/pyplots/boxplot_demo_pyplot.py

-89
This file was deleted.

examples/pyplots/fig_axes_labels_simple.py

-42
This file was deleted.

examples/pyplots/pyplot_formatstr.py

-21
This file was deleted.

examples/pyplots/pyplot_simple.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,15 @@
55
66
A very simple pyplot where a list of numbers are plotted against their
77
index. Creates a straight line due to the rate of change being 1 for
8-
both the X and Y axis.
8+
both the X and Y axis. Use a format string (here, 'o-r') to set the
9+
markers (circles), linestyle (solid line) and color (red).
10+
11+
.. redirect-from:: /gallery/pyplots/fig_axes_labels_simple
12+
.. redirect-from:: /gallery/pyplots/pyplot_formatstr
913
"""
1014
import matplotlib.pyplot as plt
11-
plt.plot([1, 2, 3, 4])
15+
16+
plt.plot([1, 2, 3, 4], 'o-r')
1217
plt.ylabel('some numbers')
1318
plt.show()
1419

examples/pyplots/text_layout.py

-63
This file was deleted.

examples/statistics/boxplot_demo.py

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
The following examples show off how to visualize boxplots with
99
Matplotlib. There are many options to control their appearance and
1010
the statistics that they use to summarize the data.
11+
12+
.. redirect-from:: /gallery/pyplots/boxplot_demo_pyplot
1113
"""
1214

1315
import matplotlib.pyplot as plt

examples/pyplots/auto_subplots_adjust.py renamed to examples/subplots_axes_and_figures/auto_subplots_adjust.py

+2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
This function is executed after the figure has been drawn. It can now check
3737
if the subplot leaves enough room for the text. If not, the subplot parameters
3838
are updated and second draw is triggered.
39+
40+
.. redirect-from:: /gallery/pyplots/auto_subplots_adjust
3941
"""
4042

4143
import matplotlib.pyplot as plt

examples/pyplots/align_ylabels.py renamed to examples/text_labels_and_annotations/align_ylabels.py

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
Two methods are shown here, one using a short call to `.Figure.align_ylabels`
77
and the second a manual way to align the labels.
88
9+
.. redirect-from:: /gallery/pyplots/align_ylabels
910
"""
1011
import numpy as np
1112
import matplotlib.pyplot as plt

examples/pyplots/annotate_transform.py renamed to examples/text_labels_and_annotations/annotate_transform.py

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
This example shows how to use different coordinate systems for annotations.
77
For a complete overview of the annotation capabilities, also see the
88
:doc:`annotation tutorial</tutorials/text/annotations>`.
9+
10+
.. redirect-from:: /gallery/pyplots/annotate_transform
911
"""
1012

1113
import numpy as np

examples/pyplots/annotation_basic.py renamed to examples/text_labels_and_annotations/annotation_basic.py

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
99
For a complete overview of the annotation capabilities, also see the
1010
:doc:`annotation tutorial</tutorials/text/annotations>`.
11+
12+
.. redirect-from:: /gallery/pyplots/annotation_basic
1113
"""
1214
import numpy as np
1315
import matplotlib.pyplot as plt

examples/pyplots/annotation_polar.py renamed to examples/text_labels_and_annotations/annotation_polar.py

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
88
For a complete overview of the annotation capabilities, also see the
99
:doc:`annotation tutorial</tutorials/text/annotations>`.
10+
11+
.. redirect-from:: /gallery/pyplots/annotation_polar
1012
"""
1113
import numpy as np
1214
import matplotlib.pyplot as plt

examples/text_labels_and_annotations/text_alignment.py

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
Texts are aligned relative to their anchor point depending on the properties
77
``horizontalalignment`` and ``verticalalignment``.
88
9+
.. redirect-from:: /gallery/pyplots/text_layout
10+
911
.. plot::
1012
1113
import matplotlib.pyplot as plt

examples/pyplots/text_commands.py renamed to examples/text_labels_and_annotations/text_commands.py

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
=============
55
66
Plotting text of many different kinds.
7+
8+
.. redirect-from:: /gallery/pyplots/text_commands
79
"""
810

911
import matplotlib.pyplot as plt

examples/pyplots/dollar_ticks.py renamed to examples/ticks/dollar_ticks.py

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
============
55
66
Use a `~.ticker.FormatStrFormatter` to prepend dollar signs on y axis labels.
7+
8+
.. redirect-from:: /gallery/pyplots/dollar_ticks
79
"""
810
import numpy as np
911
import matplotlib.pyplot as plt

examples/pyplots/fig_axes_customize_simple.py renamed to examples/ticks/fig_axes_customize_simple.py

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
=========================
55
66
Customize the background, labels and ticks of a simple plot.
7+
8+
.. redirect-from:: /gallery/pyplots/fig_axes_customize_simple
79
"""
810

911
import matplotlib.pyplot as plt

examples/ticks/tick-formatters.py

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
is formatted as a string.
88
99
This example illustrates the usage and effect of the most common formatters.
10+
11+
.. redirect-from:: /gallery/pyplots/dollar_ticks
1012
"""
1113

1214
import matplotlib.pyplot as plt

tutorials/intermediate/artists.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,6 @@ class in the Matplotlib API, and the one you will be working with most
719719
# dollar signs and colors them green on the right side of the yaxis.
720720
#
721721
#
722-
# .. include:: ../../gallery/pyplots/dollar_ticks.rst
722+
# .. include:: ../../gallery/ticks/dollar_ticks.rst
723723
# :start-after: y axis labels.
724724
# :end-before: .. admonition:: References

tutorials/text/annotations.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
# *xy* and the location of the text *xytext*. Both of these
2626
# arguments are ``(x, y)`` tuples.
2727
#
28-
# .. figure:: ../../gallery/pyplots/images/sphx_glr_annotation_basic_001.png
29-
# :target: ../../gallery/pyplots/annotation_basic.html
28+
# .. figure:: ../../gallery/text_labels_and_annotations/images/sphx_glr_annotation_basic_001.png
29+
# :target: ../../gallery/text_labels_and_annotations/annotation_basic.html
3030
# :align: center
3131
#
3232
# In this example, both the *xy* (arrow tip) and *xytext* locations
@@ -86,8 +86,8 @@
8686
# *fontsize* are passed from `~matplotlib.axes.Axes.annotate` to the
8787
# ``Text`` instance.
8888
#
89-
# .. figure:: ../../gallery/pyplots/images/sphx_glr_annotation_polar_001.png
90-
# :target: ../../gallery/pyplots/annotation_polar.html
89+
# .. figure:: ../../gallery/text_labels_and_annotations/images/sphx_glr_annotation_polar_001.png
90+
# :target: ../../gallery/text_labels_and_annotations/annotation_polar.html
9191
# :align: center
9292
#
9393
# For more on all the wild and wonderful things you can do with

0 commit comments

Comments
 (0)