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

Skip to content

Move remaining examples from api/ #11136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 29, 2018
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
2 changes: 0 additions & 2 deletions doc/api/pyplot_summary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ While it is easy to quickly generate plots with the
we recommend using the object-oriented approach for more control
and customization of your plots. See the methods in the
:meth:`matplotlib.axes.Axes` class for many of the same plotting functions.
For examples of the OO approach to Matplotlib, see the
:ref:`API Examples<api_examples>`.

Colors in Matplotlib
--------------------
Expand Down
7 changes: 4 additions & 3 deletions doc/faq/howto_faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ Finally, the multipage pdf object has to be closed::
pp.close()

The same can be done using the pgf backend::

from matplotlib.backends.backend_pgf import PdfPages


Expand Down Expand Up @@ -415,7 +415,8 @@ locators as desired because the two axes are independent.

.. only:: html

See :doc:`/gallery/api/two_scales` for a complete example
See :doc:`/gallery/subplots_axes_and_figures/two_scales` for a
complete example.

.. _howto-batch:

Expand Down Expand Up @@ -661,7 +662,7 @@ For more on configuring your backend, see

Alternatively, you can avoid pylab/pyplot altogether, which will give
you a little more control, by calling the API directly as shown in
:doc:`/gallery/api/agg_oo_sgskip`.
:doc:`/gallery/misc/agg_oo_sgskip`.

You can either generate hardcopy on the filesystem by calling savefig::

Expand Down
9 changes: 5 additions & 4 deletions doc/users/prev_whats_new/whats_new_1.1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ Sankey Diagrams

Kevin Davies has extended Yannick Copin's original Sankey example into a module
(:mod:`~matplotlib.sankey`) and provided new examples
(:doc:`/gallery/api/sankey_basics`, :doc:`/gallery/api/sankey_links`,
:doc:`/gallery/api/sankey_rankine`).
(:doc:`/gallery/specialty_plots/sankey_basics`,
:doc:`/gallery/specialty_plots/sankey_links`,
:doc:`/gallery/specialty_plots/sankey_rankine`).

.. figure:: ../../gallery/api/images/sphx_glr_sankey_rankine_001.png
:target: ../../gallery/api/sankey_rankine.html
.. figure:: ../../gallery/specialty_plots/images/sphx_glr_sankey_rankine_001.png
:target: ../../gallery/specialty_plots/sankey_rankine.html
:align: center
:scale: 50

Expand Down
4 changes: 2 additions & 2 deletions doc/users/prev_whats_new/whats_new_1.4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ matplotlib internals were cleaned up to support using such transforms in
:class:`~matplotlib.Axes`. This transform is important for some plot types,
specifically the Skew-T used in meteorology.

.. figure:: ../../gallery/api/images/sphx_glr_skewt_001.png
:target: ../../gallery/api/skewt.html
.. figure:: ../../gallery/specialty_plots/images/sphx_glr_skewt_001.png
:target: ../../gallery/specialty_plots/skewt.html
:align: center
:scale: 50

Expand Down
4 changes: 2 additions & 2 deletions doc/users/prev_whats_new/whats_new_1.5.rst
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,8 @@ kwargs names is not ideal, but `Axes.fill_between` already has a

This is particularly useful for plotting pre-binned histograms.

.. figure:: ../../gallery/api/images/sphx_glr_filled_step_001.png
:target: ../../gallery/api/filled_step.html
.. figure:: ../../gallery/lines_bars_and_markers/images/sphx_glr_filled_step_001.png
:target: ../../gallery/lines_bars_and_markers/filled_step.html
:align: center
:scale: 50

Expand Down
2 changes: 0 additions & 2 deletions examples/README
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ Below is a brief description of the different directories found here:
* animation - Dynamic plots, see the documentation at
http://matplotlib.org/api/animation_api.html

* api - working with the Matplotlib API directly.

* axes_grid1 - Examples related to the axes_grid1 toolkit.

* axisartist - Examples related to the axisartist toolkit.
Expand Down
18 changes: 0 additions & 18 deletions examples/api/README.txt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Watermark image
===============

Use a PNG file as a watermark
Using a PNG file as a watermark.
"""
import numpy as np
import matplotlib.cbook as cbook
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
================

Illustrate some helper functions for shading regions where a logical
mask is True
mask is True.

See :meth:`matplotlib.collections.BrokenBarHCollection.span_where`
"""
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
Plots with different scales
===========================

Demonstrate how to do two plots on the same axes with different left and
right scales.
Two plots on the same axes with different left and right scales.

The trick is to use *two different axes* that share the same *x* axis.
You can use separate `matplotlib.ticker` formatters and locators as
Expand Down
Binary file added examples/test2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
Here, we use the Computer Modern roman font (``cmr10``) shipped with
Matplotlib.

For a more flexible solution, see :doc:`/gallery/api/font_family_rc_sgskip` and
For a more flexible solution, see
:doc:`/gallery/text_labels_and_annotations/font_family_rc_sgskip` and
:doc:`/gallery/text_labels_and_annotations/fonts_demo`.
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
legend = ax.legend(loc='upper center', shadow=True, fontsize='x-large')

# Put a nicer background color on the legend.
legend.get_frame().set_facecolor('#00FFCC')
legend.get_frame().set_facecolor('C0')

plt.show()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
Text watermark
==============

Use a Text as a watermark
Adding a text watermark.
"""
import numpy as np
#import matplotlib
#matplotlib.use('Agg')

import matplotlib.pyplot as plt

# Fixing random state for reproducibility
Expand All @@ -19,7 +16,6 @@
ax.plot(np.random.rand(20), '-o', ms=20, lw=2, alpha=0.7, mfc='orange')
ax.grid()

# position bottom right
fig.text(0.95, 0.05, 'Property of MPL',
fontsize=50, color='gray',
ha='right', va='bottom', alpha=0.5)
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ def legend(self, *args, **kwargs):
Examples
--------

.. plot:: gallery/api/legend.py
.. plot:: gallery/text_labels_and_annotations/legend.py

"""
handles, labels, extra_args, kwargs = mlegend._parse_legend_args(
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ def make_compound_path_from_polys(cls, XY):
numsides x 2) numpy array of vertices. Return object is a
:class:`Path`

.. plot:: gallery/api/histogram_path.py
.. plot:: gallery/misc/histogram_path.py

"""

Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/sankey.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def __init__(self, ax=None, scale=1.0, unit='', format='%G', gap=0.25,

**Examples:**

.. plot:: gallery/api/sankey_basics.py
.. plot:: gallery/specialty_plots/sankey_basics.py
"""
# Check the arguments.
if gap < 0:
Expand Down
4 changes: 1 addition & 3 deletions tutorials/introductory/lifecycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@
"axis", which refers to the x/y axis of a plot).

We call methods that do the plotting directly from the Axes, which gives
us much more flexibility and power in customizing our plot. See the
:ref:`object-oriented examples <api_examples>` for many examples of how
this approach is used.
us much more flexibility and power in customizing our plot.

.. note::

Expand Down
4 changes: 2 additions & 2 deletions tutorials/introductory/sample_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,8 @@
generates figure legends, with MATLAB-compatible legend-placement
functions.

.. figure:: ../../gallery/api/images/sphx_glr_legend_001.png
:target: ../../gallery/api/legend.html
.. figure:: ../../gallery/text_labels_and_annotations/images/sphx_glr_legend_001.png
:target: ../../gallery/text_labels_and_annotations/legend.html
:align: center
:scale: 50

Expand Down