From 7d64c419c8e34b9a0a7bd7f86d16e75a1c27d837 Mon Sep 17 00:00:00 2001 From: William Granados Date: Thu, 3 Nov 2016 17:40:10 -0400 Subject: [PATCH 1/3] moved python files from doc/pyplots to examples folder updated the dynamic links for doc/pyplots to examples/pyplots fixed random state for reproducibility in pyplot examples --- doc/devel/documenting_mpl.rst | 4 ++-- doc/faq/howto_faq.rst | 4 ++-- doc/make.py | 2 +- doc/users/annotations.rst | 4 ++-- doc/users/artists.rst | 8 ++++---- doc/users/mathtext.rst | 2 +- doc/users/path_tutorial.rst | 2 +- doc/users/prev_whats_new/whats_new_0.98.4.rst | 6 +++--- doc/users/prev_whats_new/whats_new_0.99.rst | 6 +++--- doc/users/prev_whats_new/whats_new_1.0.rst | 2 +- doc/users/pyplot_tutorial.rst | 14 +++++++------- doc/users/screenshots.rst | 2 +- doc/users/text_intro.rst | 2 +- doc/users/text_props.rst | 2 +- doc/users/transforms_tutorial.rst | 2 +- doc/users/usetex.rst | 2 +- {doc => examples}/pyplots/align_ylabels.py | 2 ++ {doc => examples}/pyplots/annotate_transform.py | 0 {doc => examples}/pyplots/annotation_basic.py | 0 {doc => examples}/pyplots/annotation_polar.py | 0 {doc => examples}/pyplots/auto_subplots_adjust.py | 0 {doc => examples}/pyplots/boxplot_demo.py | 3 ++- {doc => examples}/pyplots/compound_path_demo.py | 3 +++ {doc => examples}/pyplots/dollar_ticks.py | 3 +++ {doc => examples}/pyplots/fig_axes_customize_simple.py | 0 {doc => examples}/pyplots/fig_axes_labels_simple.py | 3 +++ {doc => examples}/pyplots/fig_x.py | 0 {doc => examples}/pyplots/matplotlibrc | 0 {doc => examples}/pyplots/pyplot_annotate.py | 0 {doc => examples}/pyplots/pyplot_formatstr.py | 0 {doc => examples}/pyplots/pyplot_mathtext.py | 0 {doc => examples}/pyplots/pyplot_scales.py | 3 +++ {doc => examples}/pyplots/pyplot_simple.py | 0 {doc => examples}/pyplots/pyplot_text.py | 3 +++ {doc => examples}/pyplots/pyplot_three.py | 0 {doc => examples}/pyplots/pyplot_two_subplots.py | 0 {doc => examples}/pyplots/tex_demo.py | 0 {doc => examples}/pyplots/text_commands.py | 0 {doc => examples}/pyplots/text_layout.py | 0 {doc => examples}/pyplots/whats_new_1_subplot3d.py | 0 {doc => examples}/pyplots/whats_new_98_4_fancy.py | 0 {doc => examples}/pyplots/whats_new_98_4_fill_between.py | 0 {doc => examples}/pyplots/whats_new_98_4_legend.py | 0 {doc => examples}/pyplots/whats_new_99_axes_grid.py | 0 {doc => examples}/pyplots/whats_new_99_mplot3d.py | 0 {doc => examples}/pyplots/whats_new_99_spines.py | 0 46 files changed, 51 insertions(+), 33 deletions(-) rename {doc => examples}/pyplots/align_ylabels.py (92%) rename {doc => examples}/pyplots/annotate_transform.py (100%) rename {doc => examples}/pyplots/annotation_basic.py (100%) rename {doc => examples}/pyplots/annotation_polar.py (100%) rename {doc => examples}/pyplots/auto_subplots_adjust.py (100%) rename {doc => examples}/pyplots/boxplot_demo.py (96%) rename {doc => examples}/pyplots/compound_path_demo.py (93%) rename {doc => examples}/pyplots/dollar_ticks.py (84%) rename {doc => examples}/pyplots/fig_axes_customize_simple.py (100%) rename {doc => examples}/pyplots/fig_axes_labels_simple.py (86%) rename {doc => examples}/pyplots/fig_x.py (100%) rename {doc => examples}/pyplots/matplotlibrc (100%) rename {doc => examples}/pyplots/pyplot_annotate.py (100%) rename {doc => examples}/pyplots/pyplot_formatstr.py (100%) rename {doc => examples}/pyplots/pyplot_mathtext.py (100%) rename {doc => examples}/pyplots/pyplot_scales.py (94%) rename {doc => examples}/pyplots/pyplot_simple.py (100%) rename {doc => examples}/pyplots/pyplot_text.py (85%) rename {doc => examples}/pyplots/pyplot_three.py (100%) rename {doc => examples}/pyplots/pyplot_two_subplots.py (100%) rename {doc => examples}/pyplots/tex_demo.py (100%) rename {doc => examples}/pyplots/text_commands.py (100%) rename {doc => examples}/pyplots/text_layout.py (100%) rename {doc => examples}/pyplots/whats_new_1_subplot3d.py (100%) rename {doc => examples}/pyplots/whats_new_98_4_fancy.py (100%) rename {doc => examples}/pyplots/whats_new_98_4_fill_between.py (100%) rename {doc => examples}/pyplots/whats_new_98_4_legend.py (100%) rename {doc => examples}/pyplots/whats_new_99_axes_grid.py (100%) rename {doc => examples}/pyplots/whats_new_99_mplot3d.py (100%) rename {doc => examples}/pyplots/whats_new_99_spines.py (100%) diff --git a/doc/devel/documenting_mpl.rst b/doc/devel/documenting_mpl.rst index 85cb96039a5..cdb4a765c52 100644 --- a/doc/devel/documenting_mpl.rst +++ b/doc/devel/documenting_mpl.rst @@ -281,7 +281,7 @@ script, this will be done automatically at build time to ensure that the code that is included runs and produces the advertised figure. The path should be relative to the ``doc`` directory. Any plots -specific to the documentation should be added to the ``doc/pyplots`` +specific to the documentation should be added to the ``doc/mpl_examples/pyplots`` directory and committed to git. Plots from the ``examples`` directory may be referenced through the symlink ``mpl_examples`` in the ``doc`` directory. e.g.:: @@ -310,7 +310,7 @@ git. Please also add a line to the README in doc/pyplots for any additional requirements necessary to generate a new figure. Once these steps have been taken, these figures can be included in the usual way:: - .. plot:: pyplots/tex_unicode_demo.py + .. plot:: mpl_examples/pyplots/tex_unicode_demo.py :include-source: Examples diff --git a/doc/faq/howto_faq.rst b/doc/faq/howto_faq.rst index 0e33c11d3f2..49f30da44c4 100644 --- a/doc/faq/howto_faq.rst +++ b/doc/faq/howto_faq.rst @@ -230,7 +230,7 @@ Here is an example that gets a bounding box in relative figure coordinates (0..1) of each of the labels and uses it to move the left of the subplots over so that the tick labels fit in the figure -.. plot:: pyplots/auto_subplots_adjust.py +.. plot:: mpl_examples/pyplots/auto_subplots_adjust.py :include-source: .. _howto-ticks: @@ -273,7 +273,7 @@ behavior by specifying the coordinates of the label. The example below shows the default behavior in the left subplots, and the manual setting in the right subplots. -.. plot:: pyplots/align_ylabels.py +.. plot:: mpl_examples/pyplots/align_ylabels.py :include-source: .. _date-index-plots: diff --git a/doc/make.py b/doc/make.py index 1def9ff77bd..8882c86f6da 100755 --- a/doc/make.py +++ b/doc/make.py @@ -119,7 +119,7 @@ def clean(): 'mpl_examples/pylab_examples/*.png', 'mpl_examples/pylab_examples/*.pdf', 'mpl_examples/units/*.png', - 'pyplots/tex_demo.png', + 'mpl_examples/pyplots/tex_demo.png', '_static/matplotlibrc', '_templates/gallery.html', 'users/installing.rst']: diff --git a/doc/users/annotations.rst b/doc/users/annotations.rst index 992ef68eee3..c07481156c4 100644 --- a/doc/users/annotations.rst +++ b/doc/users/annotations.rst @@ -19,7 +19,7 @@ consider: the location being annotated represented by the argument ``xy`` and the location of the text ``xytext``. Both of these arguments are ``(x,y)`` tuples. -.. plot:: pyplots/annotation_basic.py +.. plot:: mpl_examples/pyplots/annotation_basic.py :include-source: @@ -80,7 +80,7 @@ keyword args like ``horizontalalignment``, ``verticalalignment`` and ``fontsize`` are passed from `~matplotlib.Axes.annotate` to the ``Text`` instance. -.. plot:: pyplots/annotation_polar.py +.. plot:: mpl_examples/pyplots/annotation_polar.py :include-source: For more on all the wild and wonderful things you can do with diff --git a/doc/users/artists.rst b/doc/users/artists.rst index 17f75fcac29..38c6e4dca56 100644 --- a/doc/users/artists.rst +++ b/doc/users/artists.rst @@ -133,7 +133,7 @@ drawing of the ticks, tick labels and axis labels. Try creating the figure below. -.. plot:: pyplots/fig_axes_labels_simple.py +.. plot:: mpl_examples/pyplots/fig_axes_labels_simple.py .. _customizing-artists: @@ -323,7 +323,7 @@ obtain by setting the ``Artist`` transform to :attr:`fig.transFigure In [195]: fig.canvas.draw() -.. plot:: pyplots/fig_x.py +.. plot:: mpl_examples/pyplots/fig_x.py Here is a summary of the Artists the figure contains @@ -598,7 +598,7 @@ grid Turn the grid on or off for the major or minor ticks Here is an example, not recommended for its beauty, which customizes the axes and tick properties -.. plot:: pyplots/fig_axes_customize_simple.py +.. plot:: mpl_examples/pyplots/fig_axes_customize_simple.py :include-source: @@ -635,5 +635,5 @@ label2On boolean which determines whether to draw tick label Here is an example which sets the formatter for the right side ticks with dollar signs and colors them green on the right side of the yaxis -.. plot:: pyplots/dollar_ticks.py +.. plot:: mpl_examples/pyplots/dollar_ticks.py :include-source: diff --git a/doc/users/mathtext.rst b/doc/users/mathtext.rst index e34f574d9e8..cf906d2caaf 100644 --- a/doc/users/mathtext.rst +++ b/doc/users/mathtext.rst @@ -340,5 +340,5 @@ Example Here is an example illustrating many of these features in context. -.. plot:: pyplots/pyplot_mathtext.py +.. plot:: mpl_examples/pyplots/pyplot_mathtext.py :include-source: diff --git a/doc/users/path_tutorial.rst b/doc/users/path_tutorial.rst index 4e1c1b70831..a29bc1dcdb2 100644 --- a/doc/users/path_tutorial.rst +++ b/doc/users/path_tutorial.rst @@ -184,4 +184,4 @@ All that remains is to create the path, attach it to a Here is the result -.. plot:: pyplots/compound_path_demo.py +.. plot:: mpl_examples/pyplots/compound_path_demo.py diff --git a/doc/users/prev_whats_new/whats_new_0.98.4.rst b/doc/users/prev_whats_new/whats_new_0.98.4.rst index e5749caa040..42a4eb486d2 100644 --- a/doc/users/prev_whats_new/whats_new_0.98.4.rst +++ b/doc/users/prev_whats_new/whats_new_0.98.4.rst @@ -30,7 +30,7 @@ multiple columns and rows, as well as fancy box drawing. See :func:`~matplotlib.pyplot.legend` and :class:`matplotlib.legend.Legend`. -.. plot:: pyplots/whats_new_98_4_legend.py +.. plot:: mpl_examples/pyplots/whats_new_98_4_legend.py .. _fancy-annotations: @@ -44,7 +44,7 @@ boxes and connectors in annotations. See :class:`~matplotlib.patches.ArrowStyle`, and :class:`~matplotlib.patches.ConnectionStyle`. -.. plot:: pyplots/whats_new_98_4_fancy.py +.. plot:: mpl_examples/pyplots/whats_new_98_4_fancy.py .. _psd-amplitude: @@ -84,7 +84,7 @@ can pass an *x* array and a *ylower* and *yupper* array to fill between, and an optional *where* argument which is a logical mask where you want to do the filling. -.. plot:: pyplots/whats_new_98_4_fill_between.py +.. plot:: mpl_examples/pyplots/whats_new_98_4_fill_between.py Lots more ----------- diff --git a/doc/users/prev_whats_new/whats_new_0.99.rst b/doc/users/prev_whats_new/whats_new_0.99.rst index d7ddf6d1ff9..34c2e076cea 100644 --- a/doc/users/prev_whats_new/whats_new_0.99.rst +++ b/doc/users/prev_whats_new/whats_new_0.99.rst @@ -29,7 +29,7 @@ toolkit mpl_toolkits.mplot3d (which now comes standard with all mpl installs). See :ref:`mplot3d-examples-index` and :ref:`toolkit_mplot3d-tutorial` -.. plot:: pyplots/whats_new_99_mplot3d.py +.. plot:: mpl_examples/pyplots/whats_new_99_mplot3d.py .. _whats-new-axes-grid: @@ -43,7 +43,7 @@ new mpl installs. See :ref:`axes_grid1-examples-index`, :ref:`axisartist-examples-index`, :ref:`axes_grid1_users-guide-index` and :ref:`axisartist_users-guide-index` -.. plot:: pyplots/whats_new_99_axes_grid.py +.. plot:: mpl_examples/pyplots/whats_new_99_axes_grid.py .. _whats-new-spine: @@ -58,4 +58,4 @@ well as "detach" the spine to offset it away from the data. See :ref:`pylab_examples-spine_placement_demo` and :class:`matplotlib.spines.Spine`. -.. plot:: pyplots/whats_new_99_spines.py +.. plot:: mpl_examples/pyplots/whats_new_99_spines.py diff --git a/doc/users/prev_whats_new/whats_new_1.0.rst b/doc/users/prev_whats_new/whats_new_1.0.rst index 5af33dd4fcb..bc7a336b306 100644 --- a/doc/users/prev_whats_new/whats_new_1.0.rst +++ b/doc/users/prev_whats_new/whats_new_1.0.rst @@ -82,7 +82,7 @@ supporting mixing of 2D and 3D graphs in the same figure, and/or multiple 3D graphs in a single figure, using the "projection" keyword argument to add_axes or add_subplot. Thanks Ben Root. -.. plot:: pyplots/whats_new_1_subplot3d.py +.. plot:: mpl_examples/pyplots/whats_new_1_subplot3d.py tick_params ------------ diff --git a/doc/users/pyplot_tutorial.rst b/doc/users/pyplot_tutorial.rst index 5cdf8f9941b..dfcdcf9b6b3 100644 --- a/doc/users/pyplot_tutorial.rst +++ b/doc/users/pyplot_tutorial.rst @@ -17,7 +17,7 @@ and in most places in the documentation refers to the *axes* `part of a figure `__ and not the strict mathematical term for more than one axis). -.. plot:: pyplots/pyplot_simple.py +.. plot:: mpl_examples/pyplots/pyplot_simple.py :include-source: You may be wondering why the x-axis ranges from 0-3 and the y-axis @@ -41,7 +41,7 @@ MATLAB, and you concatenate a color string with a line style string. The default format string is 'b-', which is a solid blue line. For example, to plot the above with red circles, you would issue -.. plot:: pyplots/pyplot_formatstr.py +.. plot:: mpl_examples/pyplots/pyplot_formatstr.py :include-source: See the :func:`~matplotlib.pyplot.plot` documentation for a complete @@ -57,7 +57,7 @@ converted to numpy arrays internally. The example below illustrates a plotting several lines with different format styles in one command using arrays. -.. plot:: pyplots/pyplot_three.py +.. plot:: mpl_examples/pyplots/pyplot_three.py :include-source: .. _controlling-line-properties: @@ -164,7 +164,7 @@ current axes (a :class:`matplotlib.axes.Axes` instance), and to worry about this, because it is all taken care of behind the scenes. Below is a script to create two subplots. -.. plot:: pyplots/pyplot_two_subplots.py +.. plot:: mpl_examples/pyplots/pyplot_two_subplots.py :include-source: The :func:`~matplotlib.pyplot.figure` command here is optional because @@ -231,7 +231,7 @@ an arbitrary location, and the :func:`~matplotlib.pyplot.xlabel`, are used to add text in the indicated locations (see :ref:`text-intro` for a more detailed example) -.. plot:: pyplots/pyplot_text.py +.. plot:: mpl_examples/pyplots/pyplot_text.py :include-source: @@ -277,7 +277,7 @@ two points to consider: the location being annotated represented by the argument ``xy`` and the location of the text ``xytext``. Both of these arguments are ``(x,y)`` tuples. -.. plot:: pyplots/pyplot_annotate.py +.. plot:: mpl_examples/pyplots/pyplot_annotate.py :include-source: In this basic example, both the ``xy`` (arrow tip) and ``xytext`` @@ -300,7 +300,7 @@ of magnitude. Changing the scale of an axis is easy: An example of four plots with the same data and different scales for the y axis is shown below. -.. plot:: pyplots/pyplot_scales.py +.. plot:: mpl_examples/pyplots/pyplot_scales.py :include-source: It is also possible to add your own scale, see :ref:`adding-new-scales` for diff --git a/doc/users/screenshots.rst b/doc/users/screenshots.rst index 8d3c2ee2e88..35f2810e9c3 100644 --- a/doc/users/screenshots.rst +++ b/doc/users/screenshots.rst @@ -248,7 +248,7 @@ Although matplotlib's internal math rendering engine is quite powerful, sometimes you need TeX. Matplotlib supports external TeX rendering of strings with the *usetex* option. -.. plot:: pyplots/tex_demo.py +.. plot:: mpl_examples/pyplots/tex_demo.py .. _screenshots_eeg_demo: diff --git a/doc/users/text_intro.rst b/doc/users/text_intro.rst index 824cc8d2af8..5c1da5d9ebf 100644 --- a/doc/users/text_intro.rst +++ b/doc/users/text_intro.rst @@ -58,5 +58,5 @@ All of these functions create and return a variety of font and other properties. The example below shows all of these commands in action. -.. plot:: pyplots/text_commands.py +.. plot:: mpl_examples/pyplots/text_commands.py :include-source: diff --git a/doc/users/text_props.rst b/doc/users/text_props.rst index a418ecc2935..38089f48029 100644 --- a/doc/users/text_props.rst +++ b/doc/users/text_props.rst @@ -58,7 +58,7 @@ code indicates that the coordinates are given relative to the axes bounding box, with 0,0 being the lower left of the axes and 1,1 the upper right. -.. plot:: pyplots/text_layout.py +.. plot:: mpl_examples/pyplots/text_layout.py :include-source: diff --git a/doc/users/transforms_tutorial.rst b/doc/users/transforms_tutorial.rst index 46c509dc6ad..fedf693b9f0 100644 --- a/doc/users/transforms_tutorial.rst +++ b/doc/users/transforms_tutorial.rst @@ -112,7 +112,7 @@ dpi setting. Likewise, in the figure below, the display labeled points are probably not the same as in the ipython session because the documentation figure size defaults are different. -.. plot:: pyplots/annotate_transform.py +.. plot:: mpl_examples/pyplots/annotate_transform.py .. note:: diff --git a/doc/users/usetex.rst b/doc/users/usetex.rst index 52a82f1a1b3..1e02f26e8b8 100644 --- a/doc/users/usetex.rst +++ b/doc/users/usetex.rst @@ -52,7 +52,7 @@ matplotlibrc use:: Here is the standard example, `tex_demo.py`: -.. plot:: pyplots/tex_demo.py +.. plot:: mpl_examples/pyplots/tex_demo.py :include-source: Note that display math mode (``$$ e=mc^2 $$``) is not supported, but adding the diff --git a/doc/pyplots/align_ylabels.py b/examples/pyplots/align_ylabels.py similarity index 92% rename from doc/pyplots/align_ylabels.py rename to examples/pyplots/align_ylabels.py index 1241c183629..44f78845b68 100644 --- a/doc/pyplots/align_ylabels.py +++ b/examples/pyplots/align_ylabels.py @@ -6,6 +6,8 @@ fig = plt.figure() fig.subplots_adjust(left=0.2, wspace=0.6) +# Fixing random state for reproducibility +np.random.seed(19680801) ax1 = fig.add_subplot(221) ax1.plot(2000*np.random.rand(10)) diff --git a/doc/pyplots/annotate_transform.py b/examples/pyplots/annotate_transform.py similarity index 100% rename from doc/pyplots/annotate_transform.py rename to examples/pyplots/annotate_transform.py diff --git a/doc/pyplots/annotation_basic.py b/examples/pyplots/annotation_basic.py similarity index 100% rename from doc/pyplots/annotation_basic.py rename to examples/pyplots/annotation_basic.py diff --git a/doc/pyplots/annotation_polar.py b/examples/pyplots/annotation_polar.py similarity index 100% rename from doc/pyplots/annotation_polar.py rename to examples/pyplots/annotation_polar.py diff --git a/doc/pyplots/auto_subplots_adjust.py b/examples/pyplots/auto_subplots_adjust.py similarity index 100% rename from doc/pyplots/auto_subplots_adjust.py rename to examples/pyplots/auto_subplots_adjust.py diff --git a/doc/pyplots/boxplot_demo.py b/examples/pyplots/boxplot_demo.py similarity index 96% rename from doc/pyplots/boxplot_demo.py rename to examples/pyplots/boxplot_demo.py index 8241388f0de..9c38f0aa9e4 100644 --- a/doc/pyplots/boxplot_demo.py +++ b/examples/pyplots/boxplot_demo.py @@ -7,7 +7,8 @@ import numpy as np import matplotlib.pyplot as plt -np.random.seed(0) +# Fixing random state for reproducibility +np.random.seed(19680801) # fake up some data spread = np.random.rand(50) * 100 diff --git a/doc/pyplots/compound_path_demo.py b/examples/pyplots/compound_path_demo.py similarity index 93% rename from doc/pyplots/compound_path_demo.py rename to examples/pyplots/compound_path_demo.py index 06f32ffcbf4..ed7e7d6ce32 100644 --- a/doc/pyplots/compound_path_demo.py +++ b/examples/pyplots/compound_path_demo.py @@ -7,6 +7,9 @@ fig = plt.figure() ax = fig.add_subplot(111) +# Fixing random state for reproducibility +np.random.seed(19680801) + # histogram our data with numpy data = np.random.randn(1000) n, bins = np.histogram(data, 100) diff --git a/doc/pyplots/dollar_ticks.py b/examples/pyplots/dollar_ticks.py similarity index 84% rename from doc/pyplots/dollar_ticks.py rename to examples/pyplots/dollar_ticks.py index c54b17b91b7..9c22eb4e186 100644 --- a/doc/pyplots/dollar_ticks.py +++ b/examples/pyplots/dollar_ticks.py @@ -2,6 +2,9 @@ import matplotlib.pyplot as plt import matplotlib.ticker as ticker +# Fixing random state for reproducibility +np.random.seed(19680801) + fig = plt.figure() ax = fig.add_subplot(111) ax.plot(100*np.random.rand(20)) diff --git a/doc/pyplots/fig_axes_customize_simple.py b/examples/pyplots/fig_axes_customize_simple.py similarity index 100% rename from doc/pyplots/fig_axes_customize_simple.py rename to examples/pyplots/fig_axes_customize_simple.py diff --git a/doc/pyplots/fig_axes_labels_simple.py b/examples/pyplots/fig_axes_labels_simple.py similarity index 86% rename from doc/pyplots/fig_axes_labels_simple.py rename to examples/pyplots/fig_axes_labels_simple.py index 7fd2c53a4f2..b59a9e78048 100644 --- a/doc/pyplots/fig_axes_labels_simple.py +++ b/examples/pyplots/fig_axes_labels_simple.py @@ -11,6 +11,9 @@ s = np.sin(2*np.pi*t) line, = ax1.plot(t, s, color='blue', lw=2) +# Fixing random state for reproducibility +np.random.seed(19680801) + ax2 = fig.add_axes([0.15, 0.1, 0.7, 0.3]) n, bins, patches = ax2.hist(np.random.randn(1000), 50, facecolor='yellow', edgecolor='yellow') diff --git a/doc/pyplots/fig_x.py b/examples/pyplots/fig_x.py similarity index 100% rename from doc/pyplots/fig_x.py rename to examples/pyplots/fig_x.py diff --git a/doc/pyplots/matplotlibrc b/examples/pyplots/matplotlibrc similarity index 100% rename from doc/pyplots/matplotlibrc rename to examples/pyplots/matplotlibrc diff --git a/doc/pyplots/pyplot_annotate.py b/examples/pyplots/pyplot_annotate.py similarity index 100% rename from doc/pyplots/pyplot_annotate.py rename to examples/pyplots/pyplot_annotate.py diff --git a/doc/pyplots/pyplot_formatstr.py b/examples/pyplots/pyplot_formatstr.py similarity index 100% rename from doc/pyplots/pyplot_formatstr.py rename to examples/pyplots/pyplot_formatstr.py diff --git a/doc/pyplots/pyplot_mathtext.py b/examples/pyplots/pyplot_mathtext.py similarity index 100% rename from doc/pyplots/pyplot_mathtext.py rename to examples/pyplots/pyplot_mathtext.py diff --git a/doc/pyplots/pyplot_scales.py b/examples/pyplots/pyplot_scales.py similarity index 94% rename from doc/pyplots/pyplot_scales.py rename to examples/pyplots/pyplot_scales.py index 61dcc0ce2e0..bdf2fb82370 100644 --- a/doc/pyplots/pyplot_scales.py +++ b/examples/pyplots/pyplot_scales.py @@ -3,6 +3,9 @@ from matplotlib.ticker import NullFormatter # useful for `logit` scale +# Fixing random state for reproducibility +np.random.seed(19680801) + # make up some data in the interval ]0, 1[ y = np.random.normal(loc=0.5, scale=0.4, size=1000) y = y[(y > 0) & (y < 1)] diff --git a/doc/pyplots/pyplot_simple.py b/examples/pyplots/pyplot_simple.py similarity index 100% rename from doc/pyplots/pyplot_simple.py rename to examples/pyplots/pyplot_simple.py diff --git a/doc/pyplots/pyplot_text.py b/examples/pyplots/pyplot_text.py similarity index 85% rename from doc/pyplots/pyplot_text.py rename to examples/pyplots/pyplot_text.py index 19aad305f06..b54a0f939da 100644 --- a/doc/pyplots/pyplot_text.py +++ b/examples/pyplots/pyplot_text.py @@ -1,6 +1,9 @@ import numpy as np import matplotlib.pyplot as plt +# Fixing random state for reproducibility +np.random.seed(19680801) + mu, sigma = 100, 15 x = mu + sigma * np.random.randn(10000) diff --git a/doc/pyplots/pyplot_three.py b/examples/pyplots/pyplot_three.py similarity index 100% rename from doc/pyplots/pyplot_three.py rename to examples/pyplots/pyplot_three.py diff --git a/doc/pyplots/pyplot_two_subplots.py b/examples/pyplots/pyplot_two_subplots.py similarity index 100% rename from doc/pyplots/pyplot_two_subplots.py rename to examples/pyplots/pyplot_two_subplots.py diff --git a/doc/pyplots/tex_demo.py b/examples/pyplots/tex_demo.py similarity index 100% rename from doc/pyplots/tex_demo.py rename to examples/pyplots/tex_demo.py diff --git a/doc/pyplots/text_commands.py b/examples/pyplots/text_commands.py similarity index 100% rename from doc/pyplots/text_commands.py rename to examples/pyplots/text_commands.py diff --git a/doc/pyplots/text_layout.py b/examples/pyplots/text_layout.py similarity index 100% rename from doc/pyplots/text_layout.py rename to examples/pyplots/text_layout.py diff --git a/doc/pyplots/whats_new_1_subplot3d.py b/examples/pyplots/whats_new_1_subplot3d.py similarity index 100% rename from doc/pyplots/whats_new_1_subplot3d.py rename to examples/pyplots/whats_new_1_subplot3d.py diff --git a/doc/pyplots/whats_new_98_4_fancy.py b/examples/pyplots/whats_new_98_4_fancy.py similarity index 100% rename from doc/pyplots/whats_new_98_4_fancy.py rename to examples/pyplots/whats_new_98_4_fancy.py diff --git a/doc/pyplots/whats_new_98_4_fill_between.py b/examples/pyplots/whats_new_98_4_fill_between.py similarity index 100% rename from doc/pyplots/whats_new_98_4_fill_between.py rename to examples/pyplots/whats_new_98_4_fill_between.py diff --git a/doc/pyplots/whats_new_98_4_legend.py b/examples/pyplots/whats_new_98_4_legend.py similarity index 100% rename from doc/pyplots/whats_new_98_4_legend.py rename to examples/pyplots/whats_new_98_4_legend.py diff --git a/doc/pyplots/whats_new_99_axes_grid.py b/examples/pyplots/whats_new_99_axes_grid.py similarity index 100% rename from doc/pyplots/whats_new_99_axes_grid.py rename to examples/pyplots/whats_new_99_axes_grid.py diff --git a/doc/pyplots/whats_new_99_mplot3d.py b/examples/pyplots/whats_new_99_mplot3d.py similarity index 100% rename from doc/pyplots/whats_new_99_mplot3d.py rename to examples/pyplots/whats_new_99_mplot3d.py diff --git a/doc/pyplots/whats_new_99_spines.py b/examples/pyplots/whats_new_99_spines.py similarity index 100% rename from doc/pyplots/whats_new_99_spines.py rename to examples/pyplots/whats_new_99_spines.py From 0543f77dd01c59133abe5d1b4450d13675c3e38f Mon Sep 17 00:00:00 2001 From: William Granados Date: Fri, 4 Nov 2016 19:19:03 -0400 Subject: [PATCH 2/3] added examples from pyplots to ignore list for pep8 coding standards fixed typo from previous commit; redirected to wrong file path --- lib/matplotlib/tests/test_coding_standards.py | 31 ++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/tests/test_coding_standards.py b/lib/matplotlib/tests/test_coding_standards.py index ae532ab7ef0..bb7ed2304a0 100644 --- a/lib/matplotlib/tests/test_coding_standards.py +++ b/lib/matplotlib/tests/test_coding_standards.py @@ -265,7 +265,36 @@ def test_pep8_conformance_examples(): '*/pylab_examples/tricontour_demo.py', '*/pylab_examples/tripcolor_demo.py', '*/pylab_examples/triplot_demo.py', - '*/shapes_and_collections/artist_reference.py'] + '*/shapes_and_collections/artist_reference.py', + '*/pyplots/align_ylabels.py', + '*/pyplots/pyplot_scales.py', + '*/pyplots/annotate_transform.py', + '*/pyplots/pyplot_simple.py', + '*/pyplots/annotation_basic.py', + '*/pyplots/pyplot_text.py', + '*/pyplots/annotation_polar.py', + '*/pyplots/pyplot_three.py', + '*/pyplots/auto_subplots_adjust.py', + '*/pyplots/pyplot_two_subplots.py', + '*/pyplots/boxplot_demo.py', + '*/pyplots/tex_demo.py', + '*/pyplots/compound_path_demo.py', + '*/pyplots/text_commands.py', + '*/pyplots/dollar_ticks.py', + '*/pyplots/text_layout.py', + '*/pyplots/fig_axes_customize_simple.py', + '*/pyplots/whats_new_1_subplot3d.py', + '*/pyplots/fig_axes_labels_simple.py', + '*/pyplots/whats_new_98_4_fancy.py', + '*/pyplots/fig_x.py', + '*/pyplots/whats_new_98_4_fill_between.py', + '*/pyplots/whats_new_98_4_legend.py', + '*/pyplots/pyplot_annotate.py', + '*/pyplots/whats_new_99_axes_grid.py', + '*/pyplots/pyplot_formatstr.py', + '*/pyplots/whats_new_99_mplot3d.py', + '*/pyplots/pyplot_mathtext.py', + '*/pyplots/whats_new_99_spines.py'] assert_pep8_conformance(dirname=exdir, extra_exclude_directories=blacklist, pep8_additional_ignore=PEP8_ADDITIONAL_IGNORE + From 5748c2e94768647a3302c020746def66274a9bce Mon Sep 17 00:00:00 2001 From: Nelle Varoquaux Date: Fri, 4 Nov 2016 21:48:32 -0700 Subject: [PATCH 3/3] FIX pep8 failed as some files are pep8 compliant --- lib/matplotlib/tests/test_coding_standards.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/matplotlib/tests/test_coding_standards.py b/lib/matplotlib/tests/test_coding_standards.py index bb7ed2304a0..70490e6ad03 100644 --- a/lib/matplotlib/tests/test_coding_standards.py +++ b/lib/matplotlib/tests/test_coding_standards.py @@ -267,13 +267,10 @@ def test_pep8_conformance_examples(): '*/pylab_examples/triplot_demo.py', '*/shapes_and_collections/artist_reference.py', '*/pyplots/align_ylabels.py', - '*/pyplots/pyplot_scales.py', '*/pyplots/annotate_transform.py', '*/pyplots/pyplot_simple.py', '*/pyplots/annotation_basic.py', - '*/pyplots/pyplot_text.py', '*/pyplots/annotation_polar.py', - '*/pyplots/pyplot_three.py', '*/pyplots/auto_subplots_adjust.py', '*/pyplots/pyplot_two_subplots.py', '*/pyplots/boxplot_demo.py', @@ -292,7 +289,6 @@ def test_pep8_conformance_examples(): '*/pyplots/pyplot_annotate.py', '*/pyplots/whats_new_99_axes_grid.py', '*/pyplots/pyplot_formatstr.py', - '*/pyplots/whats_new_99_mplot3d.py', '*/pyplots/pyplot_mathtext.py', '*/pyplots/whats_new_99_spines.py'] assert_pep8_conformance(dirname=exdir,