From d0671d95d02ebddf3c4049eca568c2fc755f27aa Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Thu, 29 Apr 2021 20:34:03 -0400 Subject: [PATCH 1/5] Embed `whats_new_*` examples in What's new pages. There's no need for these to be separate as we can use `.. plot::` to embed them, and there already exist examples that show these things off. --- .flake8 | 6 - doc/users/prev_whats_new/whats_new_0.98.4.rst | 34 +++-- doc/users/prev_whats_new/whats_new_0.99.rst | 117 +++++++++++++++--- doc/users/prev_whats_new/whats_new_1.0.rst | 27 +++- examples/pyplots/whats_new_1_subplot3d.py | 44 ------- .../pyplots/whats_new_98_4_fill_between.py | 30 ----- examples/pyplots/whats_new_98_4_legend.py | 32 ----- examples/pyplots/whats_new_99_axes_grid.py | 60 --------- examples/pyplots/whats_new_99_mplot3d.py | 34 ----- examples/pyplots/whats_new_99_spines.py | 67 ---------- 10 files changed, 147 insertions(+), 304 deletions(-) delete mode 100644 examples/pyplots/whats_new_1_subplot3d.py delete mode 100644 examples/pyplots/whats_new_98_4_fill_between.py delete mode 100644 examples/pyplots/whats_new_98_4_legend.py delete mode 100644 examples/pyplots/whats_new_99_axes_grid.py delete mode 100644 examples/pyplots/whats_new_99_mplot3d.py delete mode 100644 examples/pyplots/whats_new_99_spines.py diff --git a/.flake8 b/.flake8 index d726b4443ca4..e091cab4dcb7 100644 --- a/.flake8 +++ b/.flake8 @@ -213,12 +213,6 @@ per-file-ignores = examples/pyplots/pyplot_two_subplots.py: E402 examples/pyplots/text_commands.py: E402 examples/pyplots/text_layout.py: E402 - examples/pyplots/whats_new_1_subplot3d.py: E402 - examples/pyplots/whats_new_98_4_fill_between.py: E402 - examples/pyplots/whats_new_98_4_legend.py: E402 - examples/pyplots/whats_new_99_axes_grid.py: E402 - examples/pyplots/whats_new_99_mplot3d.py: E402 - examples/pyplots/whats_new_99_spines.py: E402 examples/scales/power_norm.py: E402 examples/scales/scales.py: E402 examples/shapes_and_collections/artist_reference.py: E402 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 96f8768a99d8..8e4635c175dd 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,12 +30,18 @@ multiple columns and rows, as well as fancy box drawing. See :func:`~matplotlib.pyplot.legend` and :class:`matplotlib.legend.Legend`. -.. figure:: ../../gallery/pyplots/images/sphx_glr_whats_new_98_4_legend_001.png - :target: ../../gallery/pyplots/whats_new_98_4_legend.html - :align: center - :scale: 50 +.. plot:: + + ax = plt.subplot() + t1 = np.arange(0.0, 1.0, 0.01) + for n in [1, 2, 3, 4]: + plt.plot(t1, t1**n, label=f"n={n}") + + leg = plt.legend(loc='best', ncol=2, mode="expand", shadow=True, fancybox=True) + leg.get_frame().set_alpha(0.5) + + plt.show() - What's New 98 4 Legend .. _fancy-annotations: @@ -145,12 +151,20 @@ 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. -.. figure:: ../../gallery/pyplots/images/sphx_glr_whats_new_98_4_fill_between_001.png - :target: ../../gallery/pyplots/whats_new_98_4_fill_between.html - :align: center - :scale: 50 +.. plot:: + + x = np.arange(-5, 5, 0.01) + y1 = -5*x*x + x + 10 + y2 = 5*x*x + x + + fig, ax = plt.subplots() + ax.plot(x, y1, x, y2, color='black') + ax.fill_between(x, y1, y2, where=(y2 > y1), facecolor='yellow', alpha=0.5) + ax.fill_between(x, y1, y2, where=(y2 <= y1), facecolor='red', alpha=0.5) + ax.set_title('Fill Between') + + plt.show() - What's New 98 4 Fill Between 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 2a74e39e6b55..6dbdbf8dda9b 100644 --- a/doc/users/prev_whats_new/whats_new_0.99.rst +++ b/doc/users/prev_whats_new/whats_new_0.99.rst @@ -22,19 +22,29 @@ working with paths and transformations: :doc:`/tutorials/advanced/path_tutorial` mplot3d -------- - Reinier Heeres has ported John Porter's mplot3d over to the new matplotlib transformations framework, and it is now available as a toolkit mpl_toolkits.mplot3d (which now comes standard with all mpl installs). See :ref:`mplot3d-examples-index` and :ref:`toolkit_mplot3d-tutorial` -.. figure:: ../../gallery/pyplots/images/sphx_glr_whats_new_99_mplot3d_001.png - :target: ../../gallery/pyplots/whats_new_99_mplot3d.html - :align: center - :scale: 50 +.. plot:: + + from matplotlib import cm + from mpl_toolkits.mplot3d import Axes3D + + X = np.arange(-5, 5, 0.25) + Y = np.arange(-5, 5, 0.25) + X, Y = np.meshgrid(X, Y) + R = np.sqrt(X**2 + Y**2) + Z = np.sin(R) + + fig = plt.figure() + ax = Axes3D(fig, auto_add_to_figure=False) + fig.add_axes(ax) + ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.viridis) - What's New 99 Mplot3d + plt.show() .. _whats-new-axes-grid: @@ -48,12 +58,49 @@ 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` -.. figure:: ../../gallery/pyplots/images/sphx_glr_whats_new_99_axes_grid_001.png - :target: ../../gallery/pyplots/whats_new_99_axes_grid.html - :align: center - :scale: 50 +.. plot:: + + from mpl_toolkits.axes_grid1.axes_rgb import RGBAxes + + + def get_demo_image(): + # prepare image + delta = 0.5 + + extent = (-3, 4, -4, 3) + x = np.arange(-3.0, 4.001, delta) + y = np.arange(-4.0, 3.001, delta) + X, Y = np.meshgrid(x, y) + Z1 = np.exp(-X**2 - Y**2) + Z2 = np.exp(-(X - 1)**2 - (Y - 1)**2) + Z = (Z1 - Z2) * 2 + + return Z, extent + + + def get_rgb(): + Z, extent = get_demo_image() + + Z[Z < 0] = 0. + Z = Z / Z.max() + + R = Z[:13, :13] + G = Z[2:, 2:] + B = Z[:13, 2:] + + return R, G, B - What's New 99 Axes Grid + + fig = plt.figure() + ax = RGBAxes(fig, [0.1, 0.1, 0.8, 0.8]) + + r, g, b = get_rgb() + ax.imshow_rgb(r, g, b, origin="lower") + + ax.RGB.set_xlim(0., 9.5) + ax.RGB.set_ylim(0.9, 10.6) + + plt.show() .. _whats-new-spine: @@ -68,9 +115,47 @@ well as "detach" the spine to offset it away from the data. See :doc:`/gallery/ticks_and_spines/spine_placement_demo` and :class:`matplotlib.spines.Spine`. -.. figure:: ../../gallery/pyplots/images/sphx_glr_whats_new_99_spines_001.png - :target: ../../gallery/pyplots/whats_new_99_spines.html - :align: center - :scale: 50 +.. plot:: + + def adjust_spines(ax, spines): + for loc, spine in ax.spines.items(): + if loc in spines: + spine.set_position(('outward', 10)) # outward by 10 points + else: + spine.set_color('none') # don't draw spine + + # turn off ticks where there is no spine + if 'left' in spines: + ax.yaxis.set_ticks_position('left') + else: + # no yaxis ticks + ax.yaxis.set_ticks([]) + + if 'bottom' in spines: + ax.xaxis.set_ticks_position('bottom') + else: + # no xaxis ticks + ax.xaxis.set_ticks([]) + + fig = plt.figure() + + x = np.linspace(0, 2*np.pi, 100) + y = 2*np.sin(x) + + ax = fig.add_subplot(2, 2, 1) + ax.plot(x, y) + adjust_spines(ax, ['left']) + + ax = fig.add_subplot(2, 2, 2) + ax.plot(x, y) + adjust_spines(ax, []) + + ax = fig.add_subplot(2, 2, 3) + ax.plot(x, y) + adjust_spines(ax, ['left', 'bottom']) + + ax = fig.add_subplot(2, 2, 4) + ax.plot(x, y) + adjust_spines(ax, ['bottom']) - What's New 99 Spines + plt.show() 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 cafa8917d518..1865ac5c286e 100644 --- a/doc/users/prev_whats_new/whats_new_1.0.rst +++ b/doc/users/prev_whats_new/whats_new_1.0.rst @@ -92,12 +92,29 @@ 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. -.. figure:: ../../gallery/pyplots/images/sphx_glr_whats_new_1_subplot3d_001.png - :target: ../../gallery/pyplots/whats_new_1_subplot3d.html - :align: center - :scale: 50 +.. plot:: + + from mpl_toolkits.mplot3d.axes3d import get_test_data + + fig = plt.figure() + + X = np.arange(-5, 5, 0.25) + Y = np.arange(-5, 5, 0.25) + X, Y = np.meshgrid(X, Y) + R = np.sqrt(X**2 + Y**2) + Z = np.sin(R) + ax = fig.add_subplot(1, 2, 1, projection='3d') + surf = ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap='viridis', + linewidth=0, antialiased=False) + ax.set_zlim3d(-1.01, 1.01) + + fig.colorbar(surf, shrink=0.5, aspect=5) + + X, Y, Z = get_test_data(0.05) + ax = fig.add_subplot(1, 2, 2, projection='3d') + ax.plot_wireframe(X, Y, Z, rstride=10, cstride=10) - What's New 1 Subplot3d + plt.show() tick_params ----------- diff --git a/examples/pyplots/whats_new_1_subplot3d.py b/examples/pyplots/whats_new_1_subplot3d.py deleted file mode 100644 index d1d11128d2c2..000000000000 --- a/examples/pyplots/whats_new_1_subplot3d.py +++ /dev/null @@ -1,44 +0,0 @@ -""" -====================== -What's New 1 Subplot3d -====================== - -Create two three-dimensional plots in the same figure. -""" - -from matplotlib import cm -import matplotlib.pyplot as plt -import numpy as np - -fig = plt.figure() - -ax = fig.add_subplot(1, 2, 1, projection='3d') -X = np.arange(-5, 5, 0.25) -Y = np.arange(-5, 5, 0.25) -X, Y = np.meshgrid(X, Y) -R = np.sqrt(X**2 + Y**2) -Z = np.sin(R) -surf = ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.viridis, - linewidth=0, antialiased=False) -ax.set_zlim3d(-1.01, 1.01) - -fig.colorbar(surf, shrink=0.5, aspect=5) - -from mpl_toolkits.mplot3d.axes3d import get_test_data -ax = fig.add_subplot(1, 2, 2, projection='3d') -X, Y, Z = get_test_data(0.05) -ax.plot_wireframe(X, Y, Z, rstride=10, cstride=10) - -plt.show() - -############################################################################# -# -# .. admonition:: References -# -# The use of the following functions, methods, classes and modules is shown -# in this example: -# -# - `matplotlib.figure.Figure.add_subplot` -# - `mpl_toolkits.mplot3d.axes3d.Axes3D.plot_surface` -# - `mpl_toolkits.mplot3d.axes3d.Axes3D.plot_wireframe` -# - `mpl_toolkits.mplot3d.axes3d.Axes3D.set_zlim3d` diff --git a/examples/pyplots/whats_new_98_4_fill_between.py b/examples/pyplots/whats_new_98_4_fill_between.py deleted file mode 100644 index 4a61d7b8a0ab..000000000000 --- a/examples/pyplots/whats_new_98_4_fill_between.py +++ /dev/null @@ -1,30 +0,0 @@ -""" -============ -Fill Between -============ - -Fill the area between two curves. -""" -import matplotlib.pyplot as plt -import numpy as np - -x = np.arange(-5, 5, 0.01) -y1 = -5*x*x + x + 10 -y2 = 5*x*x + x - -fig, ax = plt.subplots() -ax.plot(x, y1, x, y2, color='black') -ax.fill_between(x, y1, y2, where=(y2 > y1), facecolor='yellow', alpha=0.5) -ax.fill_between(x, y1, y2, where=(y2 <= y1), facecolor='red', alpha=0.5) -ax.set_title('Fill Between') - -plt.show() - -############################################################################# -# -# .. admonition:: References -# -# The use of the following functions, methods, classes and modules is shown -# in this example: -# -# - `matplotlib.axes.Axes.fill_between` / `matplotlib.pyplot.fill_between` diff --git a/examples/pyplots/whats_new_98_4_legend.py b/examples/pyplots/whats_new_98_4_legend.py deleted file mode 100644 index 01e7e940fc4d..000000000000 --- a/examples/pyplots/whats_new_98_4_legend.py +++ /dev/null @@ -1,32 +0,0 @@ -""" -======================== -What's New 0.98.4 Legend -======================== - -Create a legend and tweak it with a shadow and a box. -""" -import matplotlib.pyplot as plt -import numpy as np - - -ax = plt.subplot() -t1 = np.arange(0.0, 1.0, 0.01) -for n in [1, 2, 3, 4]: - plt.plot(t1, t1**n, label=f"n={n}") - -leg = plt.legend(loc='best', ncol=2, mode="expand", shadow=True, fancybox=True) -leg.get_frame().set_alpha(0.5) - - -plt.show() - -############################################################################# -# -# .. admonition:: References -# -# The use of the following functions, methods, classes and modules is shown -# in this example: -# -# - `matplotlib.axes.Axes.legend` / `matplotlib.pyplot.legend` -# - `matplotlib.legend.Legend` -# - `matplotlib.legend.Legend.get_frame` diff --git a/examples/pyplots/whats_new_99_axes_grid.py b/examples/pyplots/whats_new_99_axes_grid.py deleted file mode 100644 index fe55e37dad67..000000000000 --- a/examples/pyplots/whats_new_99_axes_grid.py +++ /dev/null @@ -1,60 +0,0 @@ -""" -========================= -What's New 0.99 Axes Grid -========================= - -Create RGB composite images. -""" -import numpy as np -import matplotlib.pyplot as plt -from mpl_toolkits.axes_grid1.axes_rgb import RGBAxes - - -def get_demo_image(): - # prepare image - delta = 0.5 - - extent = (-3, 4, -4, 3) - x = np.arange(-3.0, 4.001, delta) - y = np.arange(-4.0, 3.001, delta) - X, Y = np.meshgrid(x, y) - Z1 = np.exp(-X**2 - Y**2) - Z2 = np.exp(-(X - 1)**2 - (Y - 1)**2) - Z = (Z1 - Z2) * 2 - - return Z, extent - - -def get_rgb(): - Z, extent = get_demo_image() - - Z[Z < 0] = 0. - Z = Z / Z.max() - - R = Z[:13, :13] - G = Z[2:, 2:] - B = Z[:13, 2:] - - return R, G, B - - -fig = plt.figure() -ax = RGBAxes(fig, [0.1, 0.1, 0.8, 0.8]) - -r, g, b = get_rgb() -ax.imshow_rgb(r, g, b, origin="lower") - -ax.RGB.set_xlim(0., 9.5) -ax.RGB.set_ylim(0.9, 10.6) - -plt.show() - -############################################################################# -# -# .. admonition:: References -# -# The use of the following functions, methods, classes and modules is shown -# in this example: -# -# - `mpl_toolkits.axes_grid1.axes_rgb.RGBAxes` -# - `mpl_toolkits.axes_grid1.axes_rgb.RGBAxes.imshow_rgb` diff --git a/examples/pyplots/whats_new_99_mplot3d.py b/examples/pyplots/whats_new_99_mplot3d.py deleted file mode 100644 index cfc0cc484638..000000000000 --- a/examples/pyplots/whats_new_99_mplot3d.py +++ /dev/null @@ -1,34 +0,0 @@ -""" -======================= -What's New 0.99 Mplot3d -======================= - -Create a 3D surface plot. -""" -import numpy as np -import matplotlib.pyplot as plt -from matplotlib import cm -from mpl_toolkits.mplot3d import Axes3D - -X = np.arange(-5, 5, 0.25) -Y = np.arange(-5, 5, 0.25) -X, Y = np.meshgrid(X, Y) -R = np.sqrt(X**2 + Y**2) -Z = np.sin(R) - -fig = plt.figure() -ax = Axes3D(fig, auto_add_to_figure=False) -fig.add_axes(ax) -ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.viridis) - -plt.show() - -############################################################################# -# -# .. admonition:: References -# -# The use of the following functions, methods, classes and modules is shown -# in this example: -# -# - `mpl_toolkits.mplot3d.axes3d.Axes3D` -# - `mpl_toolkits.mplot3d.axes3d.Axes3D.plot_surface` diff --git a/examples/pyplots/whats_new_99_spines.py b/examples/pyplots/whats_new_99_spines.py deleted file mode 100644 index 33cf07223d2a..000000000000 --- a/examples/pyplots/whats_new_99_spines.py +++ /dev/null @@ -1,67 +0,0 @@ -""" -====================== -What's New 0.99 Spines -====================== - -""" -import matplotlib.pyplot as plt -import numpy as np - - -def adjust_spines(ax, spines): - for loc, spine in ax.spines.items(): - if loc in spines: - spine.set_position(('outward', 10)) # outward by 10 points - else: - spine.set_color('none') # don't draw spine - - # turn off ticks where there is no spine - if 'left' in spines: - ax.yaxis.set_ticks_position('left') - else: - # no yaxis ticks - ax.yaxis.set_ticks([]) - - if 'bottom' in spines: - ax.xaxis.set_ticks_position('bottom') - else: - # no xaxis ticks - ax.xaxis.set_ticks([]) - -fig = plt.figure() - -x = np.linspace(0, 2*np.pi, 100) -y = 2*np.sin(x) - -ax = fig.add_subplot(2, 2, 1) -ax.plot(x, y) -adjust_spines(ax, ['left']) - -ax = fig.add_subplot(2, 2, 2) -ax.plot(x, y) -adjust_spines(ax, []) - -ax = fig.add_subplot(2, 2, 3) -ax.plot(x, y) -adjust_spines(ax, ['left', 'bottom']) - -ax = fig.add_subplot(2, 2, 4) -ax.plot(x, y) -adjust_spines(ax, ['bottom']) - -plt.show() - -############################################################################# -# -# .. admonition:: References -# -# The use of the following functions, methods, classes and modules is shown -# in this example: -# -# - `matplotlib.axis.Axis.set_ticks` -# - `matplotlib.axis.XAxis.set_ticks_position` -# - `matplotlib.axis.YAxis.set_ticks_position` -# - `matplotlib.spines` -# - `matplotlib.spines.Spine` -# - `matplotlib.spines.Spine.set_color` -# - `matplotlib.spines.Spine.set_position` From fe48ec7797e536671fbb08eaad08a42051e48451 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Thu, 29 Apr 2021 20:50:58 -0400 Subject: [PATCH 2/5] Clean up E302 in examples. --- .flake8 | 4 ++-- examples/pyplots/auto_subplots_adjust.py | 2 ++ examples/user_interfaces/pylab_with_gtk_sgskip.py | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.flake8 b/.flake8 index e091cab4dcb7..042b9fbba5e1 100644 --- a/.flake8 +++ b/.flake8 @@ -197,7 +197,7 @@ per-file-ignores = examples/pyplots/annotate_transform.py: E251, E402 examples/pyplots/annotation_basic.py: E402 examples/pyplots/annotation_polar.py: E402 - examples/pyplots/auto_subplots_adjust.py: E302, E402 + examples/pyplots/auto_subplots_adjust.py: E402 examples/pyplots/axline.py: E402 examples/pyplots/boxplot_demo_pyplot.py: E402 examples/pyplots/dollar_ticks.py: E402 @@ -275,7 +275,7 @@ per-file-ignores = examples/user_interfaces/gtk_spreadsheet_sgskip.py: E402 examples/user_interfaces/mathtext_wx_sgskip.py: E402 examples/user_interfaces/mpl_with_glade3_sgskip.py: E402 - examples/user_interfaces/pylab_with_gtk_sgskip.py: E302, E402 + examples/user_interfaces/pylab_with_gtk_sgskip.py: E402 examples/user_interfaces/toolmanager_sgskip.py: E402 examples/userdemo/connectionstyle_demo.py: E402 examples/userdemo/custom_boxstyle01.py: E402 diff --git a/examples/pyplots/auto_subplots_adjust.py b/examples/pyplots/auto_subplots_adjust.py index 065bdf57abaa..c11f13b14623 100644 --- a/examples/pyplots/auto_subplots_adjust.py +++ b/examples/pyplots/auto_subplots_adjust.py @@ -20,6 +20,7 @@ ax.set_yticks((2, 5, 7)) labels = ax.set_yticklabels(('really, really, really', 'long', 'labels')) + def on_draw(event): bboxes = [] for label in labels: @@ -35,6 +36,7 @@ def on_draw(event): fig.subplots_adjust(left=1.1*bbox.width) # pad a little fig.canvas.draw() + fig.canvas.mpl_connect('draw_event', on_draw) plt.show() diff --git a/examples/user_interfaces/pylab_with_gtk_sgskip.py b/examples/user_interfaces/pylab_with_gtk_sgskip.py index 561bdbad341c..277f7de2a9eb 100644 --- a/examples/user_interfaces/pylab_with_gtk_sgskip.py +++ b/examples/user_interfaces/pylab_with_gtk_sgskip.py @@ -46,6 +46,7 @@ vbox.pack_start(label, False, False, 0) vbox.reorder_child(toolbar, -1) + def update(event): if event.xdata is None: label.set_markup('Drag mouse over axes for position') @@ -53,6 +54,7 @@ def update(event): label.set_markup( f'x,y=({event.xdata}, {event.ydata})') + fig.canvas.mpl_connect('motion_notify_event', update) plt.show() From d96e442d5779653b9dd252f5c2afa543c72179c2 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Thu, 29 Apr 2021 20:57:14 -0400 Subject: [PATCH 3/5] Clear up some E501 in examples. --- .flake8 | 4 +--- examples/showcase/firefox.py | 2 +- examples/style_sheets/ggplot.py | 2 +- examples/subplots_axes_and_figures/demo_tight_layout.py | 3 ++- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.flake8 b/.flake8 index 042b9fbba5e1..2e60ff3f6825 100644 --- a/.flake8 +++ b/.flake8 @@ -233,7 +233,6 @@ per-file-ignores = examples/shapes_and_collections/scatter.py: E402 examples/showcase/anatomy.py: E402 examples/showcase/bachelors_degrees_by_gender.py: E402 - examples/showcase/firefox.py: E501 examples/specialty_plots/anscombe.py: E402 examples/specialty_plots/radar_chart.py: E402 examples/specialty_plots/sankey_basics.py: E402 @@ -241,13 +240,12 @@ per-file-ignores = examples/specialty_plots/sankey_rankine.py: E402 examples/specialty_plots/skewt.py: E402 examples/style_sheets/bmh.py: E501 - examples/style_sheets/ggplot.py: E501 examples/style_sheets/plot_solarizedlight2.py: E501 examples/subplots_axes_and_figures/axes_margins.py: E402 examples/subplots_axes_and_figures/axes_zoom_effect.py: E402 examples/subplots_axes_and_figures/custom_figure_class.py: E402 examples/subplots_axes_and_figures/demo_constrained_layout.py: E402 - examples/subplots_axes_and_figures/demo_tight_layout.py: E402, E501 + examples/subplots_axes_and_figures/demo_tight_layout.py: E402 examples/subplots_axes_and_figures/figure_size_units.py: E402 examples/subplots_axes_and_figures/secondary_axis.py: E402 examples/subplots_axes_and_figures/two_scales.py: E402 diff --git a/examples/showcase/firefox.py b/examples/showcase/firefox.py index 713809b8292d..53bda4ab2111 100644 --- a/examples/showcase/firefox.py +++ b/examples/showcase/firefox.py @@ -13,7 +13,7 @@ import matplotlib.patches as patches # From: http://raphaeljs.com/icons/#firefox -firefox = "M28.4,22.469c0.479-0.964,0.851-1.991,1.095-3.066c0.953-3.661,0.666-6.854,0.666-6.854l-0.327,2.104c0,0-0.469-3.896-1.044-5.353c-0.881-2.231-1.273-2.214-1.274-2.21c0.542,1.379,0.494,2.169,0.483,2.288c-0.01-0.016-0.019-0.032-0.027-0.047c-0.131-0.324-0.797-1.819-2.225-2.878c-2.502-2.481-5.943-4.014-9.745-4.015c-4.056,0-7.705,1.745-10.238,4.525C5.444,6.5,5.183,5.938,5.159,5.317c0,0-0.002,0.002-0.006,0.005c0-0.011-0.003-0.021-0.003-0.031c0,0-1.61,1.247-1.436,4.612c-0.299,0.574-0.56,1.172-0.777,1.791c-0.375,0.817-0.75,2.004-1.059,3.746c0,0,0.133-0.422,0.399-0.988c-0.064,0.482-0.103,0.971-0.116,1.467c-0.09,0.845-0.118,1.865-0.039,3.088c0,0,0.032-0.406,0.136-1.021c0.834,6.854,6.667,12.165,13.743,12.165l0,0c1.86,0,3.636-0.37,5.256-1.036C24.938,27.771,27.116,25.196,28.4,22.469zM16.002,3.356c2.446,0,4.73,0.68,6.68,1.86c-2.274-0.528-3.433-0.261-3.423-0.248c0.013,0.015,3.384,0.589,3.981,1.411c0,0-1.431,0-2.856,0.41c-0.065,0.019,5.242,0.663,6.327,5.966c0,0-0.582-1.213-1.301-1.42c0.473,1.439,0.351,4.17-0.1,5.528c-0.058,0.174-0.118-0.755-1.004-1.155c0.284,2.037-0.018,5.268-1.432,6.158c-0.109,0.07,0.887-3.189,0.201-1.93c-4.093,6.276-8.959,2.539-10.934,1.208c1.585,0.388,3.267,0.108,4.242-0.559c0.982-0.672,1.564-1.162,2.087-1.047c0.522,0.117,0.87-0.407,0.464-0.872c-0.405-0.466-1.392-1.105-2.725-0.757c-0.94,0.247-2.107,1.287-3.886,0.233c-1.518-0.899-1.507-1.63-1.507-2.095c0-0.366,0.257-0.88,0.734-1.028c0.58,0.062,1.044,0.214,1.537,0.466c0.005-0.135,0.006-0.315-0.001-0.519c0.039-0.077,0.015-0.311-0.047-0.596c-0.036-0.287-0.097-0.582-0.19-0.851c0.01-0.002,0.017-0.007,0.021-0.021c0.076-0.344,2.147-1.544,2.299-1.659c0.153-0.114,0.55-0.378,0.506-1.183c-0.015-0.265-0.058-0.294-2.232-0.286c-0.917,0.003-1.425-0.894-1.589-1.245c0.222-1.231,0.863-2.11,1.919-2.704c0.02-0.011,0.015-0.021-0.008-0.027c0.219-0.127-2.524-0.006-3.76,1.604C9.674,8.045,9.219,7.95,8.71,7.95c-0.638,0-1.139,0.07-1.603,0.187c-0.05,0.013-0.122,0.011-0.208-0.001C6.769,8.04,6.575,7.88,6.365,7.672c0.161-0.18,0.324-0.356,0.495-0.526C9.201,4.804,12.43,3.357,16.002,3.356z" +firefox = "M28.4,22.469c0.479-0.964,0.851-1.991,1.095-3.066c0.953-3.661,0.666-6.854,0.666-6.854l-0.327,2.104c0,0-0.469-3.896-1.044-5.353c-0.881-2.231-1.273-2.214-1.274-2.21c0.542,1.379,0.494,2.169,0.483,2.288c-0.01-0.016-0.019-0.032-0.027-0.047c-0.131-0.324-0.797-1.819-2.225-2.878c-2.502-2.481-5.943-4.014-9.745-4.015c-4.056,0-7.705,1.745-10.238,4.525C5.444,6.5,5.183,5.938,5.159,5.317c0,0-0.002,0.002-0.006,0.005c0-0.011-0.003-0.021-0.003-0.031c0,0-1.61,1.247-1.436,4.612c-0.299,0.574-0.56,1.172-0.777,1.791c-0.375,0.817-0.75,2.004-1.059,3.746c0,0,0.133-0.422,0.399-0.988c-0.064,0.482-0.103,0.971-0.116,1.467c-0.09,0.845-0.118,1.865-0.039,3.088c0,0,0.032-0.406,0.136-1.021c0.834,6.854,6.667,12.165,13.743,12.165l0,0c1.86,0,3.636-0.37,5.256-1.036C24.938,27.771,27.116,25.196,28.4,22.469zM16.002,3.356c2.446,0,4.73,0.68,6.68,1.86c-2.274-0.528-3.433-0.261-3.423-0.248c0.013,0.015,3.384,0.589,3.981,1.411c0,0-1.431,0-2.856,0.41c-0.065,0.019,5.242,0.663,6.327,5.966c0,0-0.582-1.213-1.301-1.42c0.473,1.439,0.351,4.17-0.1,5.528c-0.058,0.174-0.118-0.755-1.004-1.155c0.284,2.037-0.018,5.268-1.432,6.158c-0.109,0.07,0.887-3.189,0.201-1.93c-4.093,6.276-8.959,2.539-10.934,1.208c1.585,0.388,3.267,0.108,4.242-0.559c0.982-0.672,1.564-1.162,2.087-1.047c0.522,0.117,0.87-0.407,0.464-0.872c-0.405-0.466-1.392-1.105-2.725-0.757c-0.94,0.247-2.107,1.287-3.886,0.233c-1.518-0.899-1.507-1.63-1.507-2.095c0-0.366,0.257-0.88,0.734-1.028c0.58,0.062,1.044,0.214,1.537,0.466c0.005-0.135,0.006-0.315-0.001-0.519c0.039-0.077,0.015-0.311-0.047-0.596c-0.036-0.287-0.097-0.582-0.19-0.851c0.01-0.002,0.017-0.007,0.021-0.021c0.076-0.344,2.147-1.544,2.299-1.659c0.153-0.114,0.55-0.378,0.506-1.183c-0.015-0.265-0.058-0.294-2.232-0.286c-0.917,0.003-1.425-0.894-1.589-1.245c0.222-1.231,0.863-2.11,1.919-2.704c0.02-0.011,0.015-0.021-0.008-0.027c0.219-0.127-2.524-0.006-3.76,1.604C9.674,8.045,9.219,7.95,8.71,7.95c-0.638,0-1.139,0.07-1.603,0.187c-0.05,0.013-0.122,0.011-0.208-0.001C6.769,8.04,6.575,7.88,6.365,7.672c0.161-0.18,0.324-0.356,0.495-0.526C9.201,4.804,12.43,3.357,16.002,3.356z" # noqa def svg_parse(path): diff --git a/examples/style_sheets/ggplot.py b/examples/style_sheets/ggplot.py index a1563f1bd0d2..49b71b556d90 100644 --- a/examples/style_sheets/ggplot.py +++ b/examples/style_sheets/ggplot.py @@ -8,7 +8,7 @@ These settings were shamelessly stolen from [1]_ (with permission). -.. [1] https://web.archive.org/web/20111215111010/http://www.huyng.com/archives/sane-color-scheme-for-matplotlib/691/ +.. [1] https://everyhue.me/posts/sane-color-scheme-for-matplotlib/ .. _ggplot: https://ggplot2.tidyverse.org/ .. _R: https://www.r-project.org/ diff --git a/examples/subplots_axes_and_figures/demo_tight_layout.py b/examples/subplots_axes_and_figures/demo_tight_layout.py index edf79910c590..ca6c9f679c7a 100644 --- a/examples/subplots_axes_and_figures/demo_tight_layout.py +++ b/examples/subplots_axes_and_figures/demo_tight_layout.py @@ -140,7 +140,8 @@ def example_plot(ax): # The use of the following functions, methods, classes and modules is shown # in this example: # -# - `matplotlib.figure.Figure.tight_layout` / `matplotlib.pyplot.tight_layout` +# - `matplotlib.figure.Figure.tight_layout` / +# `matplotlib.pyplot.tight_layout` # - `matplotlib.figure.Figure.add_gridspec` # - `matplotlib.figure.Figure.add_subplot` # - `matplotlib.pyplot.subplot2grid` From 9869a025bb1667ff46e042210076e3b41b13216c Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Thu, 29 Apr 2021 22:29:30 -0400 Subject: [PATCH 4/5] Clean up E402 in examples. --- .flake8 | 10 ---------- examples/axes_grid1/inset_locator_demo.py | 2 +- examples/lines_bars_and_markers/scatter_with_legend.py | 3 ++- examples/misc/agg_buffer.py | 2 +- examples/misc/svg_filter_line.py | 9 ++++----- examples/misc/svg_filter_pie.py | 10 +++++----- examples/shapes_and_collections/ellipse_demo.py | 4 ---- examples/subplots_axes_and_figures/axes_zoom_effect.py | 4 ++-- .../font_family_rc_sgskip.py | 6 +++--- examples/text_labels_and_annotations/tex_demo.py | 4 ++-- examples/user_interfaces/canvasagg.py | 3 ++- 11 files changed, 22 insertions(+), 35 deletions(-) diff --git a/.flake8 b/.flake8 index 2e60ff3f6825..02a9e4d09f6f 100644 --- a/.flake8 +++ b/.flake8 @@ -112,7 +112,6 @@ per-file-ignores = tutorials/toolkits/axisartist.py: E501 examples/animation/frame_grabbing_sgskip.py: E402 - examples/axes_grid1/inset_locator_demo.py: E402 examples/axes_grid1/scatter_hist_locatable_axes.py: E402 examples/axisartist/demo_curvelinear_grid.py: E402 examples/color/color_by_yvalue.py: E402 @@ -170,18 +169,14 @@ per-file-ignores = examples/lines_bars_and_markers/joinstyle.py: E402 examples/lines_bars_and_markers/scatter_hist.py: E402 examples/lines_bars_and_markers/scatter_piecharts.py: E402 - examples/lines_bars_and_markers/scatter_with_legend.py: E402 examples/lines_bars_and_markers/span_regions.py: E402 examples/lines_bars_and_markers/stem_plot.py: E402 examples/lines_bars_and_markers/step_demo.py: E402 examples/lines_bars_and_markers/timeline.py: E402 examples/lines_bars_and_markers/xcorr_acorr_demo.py: E402 - examples/misc/agg_buffer.py: E402 examples/misc/histogram_path.py: E402 examples/misc/print_stdout_sgskip.py: E402 examples/misc/rasterization_demo.py: E402 - examples/misc/svg_filter_line.py: E402 - examples/misc/svg_filter_pie.py: E402 examples/misc/table_demo.py: E201 examples/mplot3d/surface3d.py: E402 examples/pie_and_polar_charts/bar_of_pie.py: E402 @@ -221,7 +216,6 @@ per-file-ignores = examples/shapes_and_collections/dolphin.py: E402 examples/shapes_and_collections/donut.py: E402 examples/shapes_and_collections/ellipse_collection.py: E402 - examples/shapes_and_collections/ellipse_demo.py: E402 examples/shapes_and_collections/fancybox_demo.py: E402 examples/shapes_and_collections/hatch_demo.py: E402 examples/shapes_and_collections/hatch_style_reference.py: E402 @@ -242,7 +236,6 @@ per-file-ignores = examples/style_sheets/bmh.py: E501 examples/style_sheets/plot_solarizedlight2.py: E501 examples/subplots_axes_and_figures/axes_margins.py: E402 - examples/subplots_axes_and_figures/axes_zoom_effect.py: E402 examples/subplots_axes_and_figures/custom_figure_class.py: E402 examples/subplots_axes_and_figures/demo_constrained_layout.py: E402 examples/subplots_axes_and_figures/demo_tight_layout.py: E402 @@ -254,19 +247,16 @@ per-file-ignores = examples/text_labels_and_annotations/demo_text_rotation_mode.py: E402 examples/text_labels_and_annotations/custom_legends.py: E402 examples/text_labels_and_annotations/fancyarrow_demo.py: E402 - examples/text_labels_and_annotations/font_family_rc_sgskip.py: E402 examples/text_labels_and_annotations/font_file.py: E402 examples/text_labels_and_annotations/legend.py: E402 examples/text_labels_and_annotations/line_with_text.py: E402 examples/text_labels_and_annotations/mathtext_asarray.py: E402 - examples/text_labels_and_annotations/tex_demo.py: E402 examples/text_labels_and_annotations/watermark_text.py: E402 examples/ticks_and_spines/custom_ticker1.py: E402 examples/ticks_and_spines/date_concise_formatter.py: E402 examples/ticks_and_spines/major_minor_demo.py: E402 examples/ticks_and_spines/tick-formatters.py: E402 examples/ticks_and_spines/tick_labels_from_values.py: E402 - examples/user_interfaces/canvasagg.py: E402 examples/user_interfaces/embedding_in_gtk3_panzoom_sgskip.py: E402 examples/user_interfaces/embedding_in_gtk3_sgskip.py: E402 examples/user_interfaces/embedding_in_qt_sgskip.py: E402 diff --git a/examples/axes_grid1/inset_locator_demo.py b/examples/axes_grid1/inset_locator_demo.py index 56b5a8357e10..16e3cab5f964 100644 --- a/examples/axes_grid1/inset_locator_demo.py +++ b/examples/axes_grid1/inset_locator_demo.py @@ -135,7 +135,7 @@ # Create an inset horizontally centered in figure coordinates and vertically # bound to line up with the axes. -from matplotlib.transforms import blended_transform_factory +from matplotlib.transforms import blended_transform_factory # noqa transform = blended_transform_factory(fig.transFigure, ax2.transAxes) axins4 = inset_axes(ax2, width="16%", height="34%", bbox_to_anchor=(0, 0, 1, 1), diff --git a/examples/lines_bars_and_markers/scatter_with_legend.py b/examples/lines_bars_and_markers/scatter_with_legend.py index fed8dd1c44f7..56e539644bf9 100644 --- a/examples/lines_bars_and_markers/scatter_with_legend.py +++ b/examples/lines_bars_and_markers/scatter_with_legend.py @@ -12,9 +12,10 @@ """ import numpy as np -np.random.seed(19680801) import matplotlib.pyplot as plt +np.random.seed(19680801) + fig, ax = plt.subplots() for color in ['tab:blue', 'tab:orange', 'tab:green']: diff --git a/examples/misc/agg_buffer.py b/examples/misc/agg_buffer.py index e63dcbfda1f6..ca0631fcb7f0 100644 --- a/examples/misc/agg_buffer.py +++ b/examples/misc/agg_buffer.py @@ -8,6 +8,7 @@ """ import numpy as np +from PIL import Image from matplotlib.backends.backend_agg import FigureCanvasAgg import matplotlib.pyplot as plt @@ -21,7 +22,6 @@ X = np.asarray(agg.buffer_rgba()) # Pass off to PIL. -from PIL import Image im = Image.fromarray(X) # Uncomment this line to display the image using ImageMagick's `display` tool. diff --git a/examples/misc/svg_filter_line.py b/examples/misc/svg_filter_line.py index d329e6f243b1..8e790a708628 100644 --- a/examples/misc/svg_filter_line.py +++ b/examples/misc/svg_filter_line.py @@ -9,6 +9,8 @@ support it. """ +import io +import xml.etree.ElementTree as ET import matplotlib.pyplot as plt import matplotlib.transforms as mtransforms @@ -52,13 +54,10 @@ ax.set_ylim(0., 1.) # save the figure as a bytes string in the svg format. -from io import BytesIO -f = BytesIO() +f = io.BytesIO() plt.savefig(f, format="svg") -import xml.etree.ElementTree as ET - # filter definition for a gaussian blur filter_def = """ Date: Thu, 29 Apr 2021 22:48:47 -0400 Subject: [PATCH 5/5] Drop unnecessary flake8 exceptions for examples. With #19774, there's no need to ignore E402 in examples. --- .flake8 | 147 ++------------------------------------------------------ 1 file changed, 3 insertions(+), 144 deletions(-) diff --git a/.flake8 b/.flake8 index 02a9e4d09f6f..2572ae55be45 100644 --- a/.flake8 +++ b/.flake8 @@ -112,161 +112,20 @@ per-file-ignores = tutorials/toolkits/axisartist.py: E501 examples/animation/frame_grabbing_sgskip.py: E402 - examples/axes_grid1/scatter_hist_locatable_axes.py: E402 - examples/axisartist/demo_curvelinear_grid.py: E402 - examples/color/color_by_yvalue.py: E402 - examples/color/color_cycle_default.py: E402 - examples/color/color_cycler.py: E402 - examples/color/color_demo.py: E402 - examples/color/colorbar_basics.py: E402 - examples/color/colormap_reference.py: E402 - examples/color/custom_cmap.py: E402 - examples/color/named_colors.py: E402 - examples/images_contours_and_fields/affine_image.py: E402 - examples/images_contours_and_fields/barb_demo.py: E402 - examples/images_contours_and_fields/barcode_demo.py: E402 - examples/images_contours_and_fields/contour_corner_mask.py: E402 - examples/images_contours_and_fields/contour_demo.py: E402 - examples/images_contours_and_fields/contour_image.py: E402 - examples/images_contours_and_fields/contourf_demo.py: E402 - examples/images_contours_and_fields/contourf_hatching.py: E402 - examples/images_contours_and_fields/contourf_log.py: E402 - examples/images_contours_and_fields/demo_bboximage.py: E402 - examples/images_contours_and_fields/image_antialiasing.py: E402 - examples/images_contours_and_fields/image_clip_path.py: E402 - examples/images_contours_and_fields/image_demo.py: E402 - examples/images_contours_and_fields/image_masked.py: E402 - examples/images_contours_and_fields/image_transparency_blend.py: E402 - examples/images_contours_and_fields/image_zcoord.py: E402 - examples/images_contours_and_fields/interpolation_methods.py: E402 - examples/images_contours_and_fields/irregulardatagrid.py: E402 - examples/images_contours_and_fields/layer_images.py: E402 - examples/images_contours_and_fields/matshow.py: E402 - examples/images_contours_and_fields/multi_image.py: E402 - examples/images_contours_and_fields/pcolor_demo.py: E402 - examples/images_contours_and_fields/plot_streamplot.py: E402 - examples/images_contours_and_fields/quadmesh_demo.py: E402 - examples/images_contours_and_fields/quiver_demo.py: E402 - examples/images_contours_and_fields/quiver_simple_demo.py: E402 - examples/images_contours_and_fields/shading_example.py: E402 - examples/images_contours_and_fields/specgram_demo.py: E402 - examples/images_contours_and_fields/spy_demos.py: E402 - examples/images_contours_and_fields/tricontour_demo.py: E201, E402 - examples/images_contours_and_fields/tricontour_smooth_delaunay.py: E402 - examples/images_contours_and_fields/tricontour_smooth_user.py: E402 - examples/images_contours_and_fields/trigradient_demo.py: E402 - examples/images_contours_and_fields/triinterp_demo.py: E402 - examples/images_contours_and_fields/tripcolor_demo.py: E201, E402 - examples/images_contours_and_fields/triplot_demo.py: E201, E402 - examples/images_contours_and_fields/watermark_image.py: E402 - examples/lines_bars_and_markers/curve_error_band.py: E402 - examples/lines_bars_and_markers/errorbar_limits_simple.py: E402 - examples/lines_bars_and_markers/fill.py: E402 - examples/lines_bars_and_markers/fill_between_demo.py: E402 - examples/lines_bars_and_markers/filled_step.py: E402 - examples/lines_bars_and_markers/stairs_demo.py: E402 - examples/lines_bars_and_markers/horizontal_barchart_distribution.py: E402 - examples/lines_bars_and_markers/joinstyle.py: E402 - examples/lines_bars_and_markers/scatter_hist.py: E402 - examples/lines_bars_and_markers/scatter_piecharts.py: E402 - examples/lines_bars_and_markers/span_regions.py: E402 - examples/lines_bars_and_markers/stem_plot.py: E402 - examples/lines_bars_and_markers/step_demo.py: E402 - examples/lines_bars_and_markers/timeline.py: E402 - examples/lines_bars_and_markers/xcorr_acorr_demo.py: E402 - examples/misc/histogram_path.py: E402 + examples/images_contours_and_fields/tricontour_demo.py: E201 + examples/images_contours_and_fields/tripcolor_demo.py: E201 + examples/images_contours_and_fields/triplot_demo.py: E201 examples/misc/print_stdout_sgskip.py: E402 - examples/misc/rasterization_demo.py: E402 examples/misc/table_demo.py: E201 - examples/mplot3d/surface3d.py: E402 - examples/pie_and_polar_charts/bar_of_pie.py: E402 - examples/pie_and_polar_charts/nested_pie.py: E402 - examples/pie_and_polar_charts/pie_and_donut_labels.py: E402 - examples/pie_and_polar_charts/pie_demo2.py: E402 - examples/pie_and_polar_charts/pie_features.py: E402 - examples/pie_and_polar_charts/polar_bar.py: E402 - examples/pie_and_polar_charts/polar_demo.py: E402 - examples/pie_and_polar_charts/polar_legend.py: E402 - examples/pie_and_polar_charts/polar_scatter.py: E402 - examples/pyplots/align_ylabels.py: E402 - examples/pyplots/annotate_transform.py: E251, E402 - examples/pyplots/annotation_basic.py: E402 - examples/pyplots/annotation_polar.py: E402 - examples/pyplots/auto_subplots_adjust.py: E402 - examples/pyplots/axline.py: E402 - examples/pyplots/boxplot_demo_pyplot.py: E402 - examples/pyplots/dollar_ticks.py: E402 - examples/pyplots/fig_axes_customize_simple.py: E402 - examples/pyplots/fig_axes_labels_simple.py: E402 - examples/pyplots/fig_x.py: E402 - examples/pyplots/pyplot_formatstr.py: E402 - examples/pyplots/pyplot_mathtext.py: E402 - examples/pyplots/pyplot_scales.py: E402 - examples/pyplots/pyplot_simple.py: E402 - examples/pyplots/pyplot_text.py: E402 - examples/pyplots/pyplot_three.py: E402 - examples/pyplots/pyplot_two_subplots.py: E402 - examples/pyplots/text_commands.py: E402 - examples/pyplots/text_layout.py: E402 - examples/scales/power_norm.py: E402 - examples/scales/scales.py: E402 - examples/shapes_and_collections/artist_reference.py: E402 - examples/shapes_and_collections/collections.py: E402 - examples/shapes_and_collections/compound_path.py: E402 - examples/shapes_and_collections/dolphin.py: E402 - examples/shapes_and_collections/donut.py: E402 - examples/shapes_and_collections/ellipse_collection.py: E402 - examples/shapes_and_collections/fancybox_demo.py: E402 - examples/shapes_and_collections/hatch_demo.py: E402 - examples/shapes_and_collections/hatch_style_reference.py: E402 - examples/shapes_and_collections/line_collection.py: E402 - examples/shapes_and_collections/marker_path.py: E402 - examples/shapes_and_collections/patch_collection.py: E402 - examples/shapes_and_collections/path_patch.py: E402 - examples/shapes_and_collections/quad_bezier.py: E402 - examples/shapes_and_collections/scatter.py: E402 - examples/showcase/anatomy.py: E402 - examples/showcase/bachelors_degrees_by_gender.py: E402 - examples/specialty_plots/anscombe.py: E402 - examples/specialty_plots/radar_chart.py: E402 - examples/specialty_plots/sankey_basics.py: E402 - examples/specialty_plots/sankey_links.py: E402 - examples/specialty_plots/sankey_rankine.py: E402 - examples/specialty_plots/skewt.py: E402 examples/style_sheets/bmh.py: E501 examples/style_sheets/plot_solarizedlight2.py: E501 - examples/subplots_axes_and_figures/axes_margins.py: E402 - examples/subplots_axes_and_figures/custom_figure_class.py: E402 examples/subplots_axes_and_figures/demo_constrained_layout.py: E402 - examples/subplots_axes_and_figures/demo_tight_layout.py: E402 - examples/subplots_axes_and_figures/figure_size_units.py: E402 - examples/subplots_axes_and_figures/secondary_axis.py: E402 - examples/subplots_axes_and_figures/two_scales.py: E402 - examples/subplots_axes_and_figures/zoom_inset_axes.py: E402 - examples/text_labels_and_annotations/date_index_formatter.py: E402 - examples/text_labels_and_annotations/demo_text_rotation_mode.py: E402 examples/text_labels_and_annotations/custom_legends.py: E402 - examples/text_labels_and_annotations/fancyarrow_demo.py: E402 - examples/text_labels_and_annotations/font_file.py: E402 - examples/text_labels_and_annotations/legend.py: E402 - examples/text_labels_and_annotations/line_with_text.py: E402 - examples/text_labels_and_annotations/mathtext_asarray.py: E402 - examples/text_labels_and_annotations/watermark_text.py: E402 - examples/ticks_and_spines/custom_ticker1.py: E402 examples/ticks_and_spines/date_concise_formatter.py: E402 - examples/ticks_and_spines/major_minor_demo.py: E402 - examples/ticks_and_spines/tick-formatters.py: E402 - examples/ticks_and_spines/tick_labels_from_values.py: E402 examples/user_interfaces/embedding_in_gtk3_panzoom_sgskip.py: E402 examples/user_interfaces/embedding_in_gtk3_sgskip.py: E402 - examples/user_interfaces/embedding_in_qt_sgskip.py: E402 examples/user_interfaces/gtk_spreadsheet_sgskip.py: E402 - examples/user_interfaces/mathtext_wx_sgskip.py: E402 examples/user_interfaces/mpl_with_glade3_sgskip.py: E402 examples/user_interfaces/pylab_with_gtk_sgskip.py: E402 examples/user_interfaces/toolmanager_sgskip.py: E402 - examples/userdemo/connectionstyle_demo.py: E402 - examples/userdemo/custom_boxstyle01.py: E402 examples/userdemo/pgf_preamble_sgskip.py: E402 - examples/widgets/*.py: E402 - examples/statistics/*.py: E402