Backport PR #24054 on branch v3.6.x ( DOC: Move OO-examples from pyplot section) by meeseeksmachine · Pull Request #24077 · matplotlib/matplotlib · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions doc/users/faq/howto_faq.rst
2 changes: 2 additions & 0 deletions examples/pyplots/fig_x.py → examples/misc/fig_x.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
=======================

Adding lines to a figure without any axes.

.. redirect-from:: /gallery/pyplots/fig_x
"""

import matplotlib.pyplot as plt
Expand Down
89 changes: 0 additions & 89 deletions examples/pyplots/boxplot_demo_pyplot.py

This file was deleted.

42 changes: 0 additions & 42 deletions examples/pyplots/fig_axes_labels_simple.py

This file was deleted.

21 changes: 0 additions & 21 deletions examples/pyplots/pyplot_formatstr.py

This file was deleted.

9 changes: 7 additions & 2 deletions examples/pyplots/pyplot_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@

A very simple pyplot where a list of numbers are plotted against their
index. Creates a straight line due to the rate of change being 1 for
both the X and Y axis.
both the X and Y axis. Use a format string (here, 'o-r') to set the
markers (circles), linestyle (solid line) and color (red).

.. redirect-from:: /gallery/pyplots/fig_axes_labels_simple
.. redirect-from:: /gallery/pyplots/pyplot_formatstr
"""
import matplotlib.pyplot as plt
plt.plot([1, 2, 3, 4])

plt.plot([1, 2, 3, 4], 'o-r')
plt.ylabel('some numbers')
plt.show()

Expand Down
63 changes: 0 additions & 63 deletions examples/pyplots/text_layout.py

This file was deleted.

2 changes: 2 additions & 0 deletions examples/statistics/boxplot_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
The following examples show off how to visualize boxplots with
Matplotlib. There are many options to control their appearance and
the statistics that they use to summarize the data.

.. redirect-from:: /gallery/pyplots/boxplot_demo_pyplot
"""

import matplotlib.pyplot as plt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
This function is executed after the figure has been drawn. It can now check
if the subplot leaves enough room for the text. If not, the subplot parameters
are updated and second draw is triggered.

.. redirect-from:: /gallery/pyplots/auto_subplots_adjust
"""

import matplotlib.pyplot as plt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
Two methods are shown here, one using a short call to `.Figure.align_ylabels`
and the second a manual way to align the labels.

.. redirect-from:: /gallery/pyplots/align_ylabels
"""
import numpy as np
import matplotlib.pyplot as plt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
This example shows how to use different coordinate systems for annotations.
For a complete overview of the annotation capabilities, also see the
:doc:`annotation tutorial</tutorials/text/annotations>`.

.. redirect-from:: /gallery/pyplots/annotate_transform
"""

import numpy as np
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

For a complete overview of the annotation capabilities, also see the
:doc:`annotation tutorial</tutorials/text/annotations>`.

.. redirect-from:: /gallery/pyplots/annotation_basic
"""
import numpy as np
import matplotlib.pyplot as plt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

For a complete overview of the annotation capabilities, also see the
:doc:`annotation tutorial</tutorials/text/annotations>`.

.. redirect-from:: /gallery/pyplots/annotation_polar
"""
import numpy as np
import matplotlib.pyplot as plt
Expand Down
2 changes: 2 additions & 0 deletions examples/text_labels_and_annotations/text_alignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
Texts are aligned relative to their anchor point depending on the properties
``horizontalalignment`` and ``verticalalignment``.

.. redirect-from:: /gallery/pyplots/text_layout

.. plot::

import matplotlib.pyplot as plt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
=============

Plotting text of many different kinds.

.. redirect-from:: /gallery/pyplots/text_commands
"""

import matplotlib.pyplot as plt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
============

Use a `~.ticker.FormatStrFormatter` to prepend dollar signs on y axis labels.

.. redirect-from:: /gallery/pyplots/dollar_ticks
"""
import numpy as np
import matplotlib.pyplot as plt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
=========================

Customize the background, labels and ticks of a simple plot.

.. redirect-from:: /gallery/pyplots/fig_axes_customize_simple
"""

import matplotlib.pyplot as plt
Expand Down
1 change: 1 addition & 0 deletions examples/ticks/tick-formatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
is formatted as a string.

This example illustrates the usage and effect of the most common formatters.

"""

import matplotlib.pyplot as plt
Expand Down
2 changes: 1 addition & 1 deletion tutorials/intermediate/artists.py
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,6 @@ class in the Matplotlib API, and the one you will be working with most
# dollar signs and colors them green on the right side of the yaxis.
#
#
# .. include:: ../../gallery/pyplots/dollar_ticks.rst
# .. include:: ../../gallery/ticks/dollar_ticks.rst
# :start-after: y axis labels.
# :end-before: .. admonition:: References
8 changes: 4 additions & 4 deletions tutorials/text/annotations.py