Skip to content

Re-enable pep8 on examples folder #11538

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 2 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: 1 addition & 1 deletion examples/axisartist/demo_parasite_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
==================

Create a parasite axes. Such axes would share the x scale with a host axes,
but show a different scale in y direction.
but show a different scale in y direction.

Note that this approach uses the `~mpl_toolkits.axes_grid1.parasite_axes`\'
`~.mpl_toolkits.axes_grid1.parasite_axes.HostAxes` and
Expand Down
2 changes: 1 addition & 1 deletion examples/axisartist/demo_parasite_axes2.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

Note that this approach uses the `mpl_toolkits.axes_grid1.parasite_axes`\'
`~mpl_toolkits.axes_grid1.parasite_axes.host_subplot` and
`mpl_toolkits.axisartist.axislines.Axes`. An alternative approach using the
`mpl_toolkits.axisartist.axislines.Axes`. An alternative approach using the
`~mpl_toolkits.axes_grid1.parasite_axes`\'s
`~.mpl_toolkits.axes_grid1.parasite_axes.HostAxes` and
`~.mpl_toolkits.axes_grid1.parasite_axes.ParasiteAxes` is the
Expand Down
1 change: 0 additions & 1 deletion examples/images_contours_and_fields/barb_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,3 @@
import matplotlib
matplotlib.axes.Axes.barbs
matplotlib.pyplot.barbs

1 change: 0 additions & 1 deletion examples/images_contours_and_fields/image_masked.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,3 @@
matplotlib.pyplot.colorbar
matplotlib.colors.BoundaryNorm
matplotlib.colorbar.ColorbarBase.set_label

2 changes: 1 addition & 1 deletion examples/images_contours_and_fields/pcolor_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Generating images with :meth:`~.axes.Axes.pcolor`.

Pcolor allows you to generate 2-D image-style plots. Below we will show how
to do so in Matplotlib.
to do so in Matplotlib.
"""
import matplotlib.pyplot as plt
import numpy as np
Expand Down
1 change: 0 additions & 1 deletion examples/images_contours_and_fields/plot_streamplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,3 @@
matplotlib.pyplot.streamplot
matplotlib.gridspec
matplotlib.gridspec.GridSpec

1 change: 0 additions & 1 deletion examples/images_contours_and_fields/quiver_simple_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,3 @@
matplotlib.pyplot.quiver
matplotlib.axes.Axes.quiverkey
matplotlib.pyplot.quiverkey

5 changes: 2 additions & 3 deletions examples/lines_bars_and_markers/marker_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ def split_list(a_list):
plt.show()



###############################################################################
# Plot all filled markers.

Expand All @@ -86,8 +85,8 @@ def split_list(a_list):
#
#
# Use :doc:`MathText </tutorials/text/mathtext>`, to use custom marker symbols,
# like e.g. ``"$\u266B$"``. For an overview over the STIX font symbols refer to the
# `STIX font table <http://www.stixfonts.org/allGlyphs.html>`_.
# like e.g. ``"$\u266B$"``. For an overview over the STIX font symbols refer
# to the `STIX font table <http://www.stixfonts.org/allGlyphs.html>`_.
# Also see the :doc:`/gallery/text_labels_and_annotations/stix_fonts_demo`.


Expand Down
18 changes: 9 additions & 9 deletions examples/misc/histogram_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@
codes = np.ones(nverts, int) * path.Path.LINETO
codes[0::5] = path.Path.MOVETO
codes[4::5] = path.Path.CLOSEPOLY
verts[0::5,0] = left
verts[0::5,1] = bottom
verts[1::5,0] = left
verts[1::5,1] = top
verts[2::5,0] = right
verts[2::5,1] = top
verts[3::5,0] = right
verts[3::5,1] = bottom
verts[0::5, 0] = left
verts[0::5, 1] = bottom
verts[1::5, 0] = left
verts[1::5, 1] = top
verts[2::5, 0] = right
verts[2::5, 1] = top
verts[3::5, 0] = right
verts[3::5, 1] = bottom

barpath = path.Path(verts, codes)

Expand All @@ -95,6 +95,6 @@
matplotlib.axes.Axes.add_patch
matplotlib.collections.PathCollection

# This example shows an alternative to
# This example shows an alternative to
matplotlib.collections.PolyCollection
matplotlib.axes.Axes.hist
7 changes: 4 additions & 3 deletions examples/pyplots/align_ylabels.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import numpy as np
import matplotlib.pyplot as plt


def make_plot(axs):
box = dict(facecolor='yellow', pad=5, alpha=0.2)

Expand All @@ -22,7 +23,7 @@ def make_plot(axs):
ax1.set_ylim(0, 2000)

ax3 = axs[1, 0]
ax3.set_ylabel('misaligned 2',bbox=box)
ax3.set_ylabel('misaligned 2', bbox=box)
ax3.plot(np.random.rand(10))

ax2 = axs[0, 1]
Expand All @@ -35,14 +36,14 @@ def make_plot(axs):
ax4.plot(np.random.rand(10))
ax4.set_ylabel('aligned 2', bbox=box)

# Plot 1:

# Plot 1:
fig, axs = plt.subplots(2, 2)
fig.subplots_adjust(left=0.2, wspace=0.6)
make_plot(axs)

# just align the last column of axes:
fig.align_ylabels(axs[:,1])
fig.align_ylabels(axs[:, 1])
plt.show()

#############################################################################
Expand Down
2 changes: 1 addition & 1 deletion examples/pyplots/pyplot_scales.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,4 @@
matplotlib.pyplot.gca
matplotlib.pyplot.yscale
matplotlib.ticker.NullFormatter
matplotlib.axis.Axis.set_minor_formatter
matplotlib.axis.Axis.set_minor_formatter
3 changes: 2 additions & 1 deletion examples/pyplots/whats_new_1_subplot3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
# The use of the following functions, methods, classes and modules is shown
# in this example:

import matplotlib, mpl_toolkits
import matplotlib
import mpl_toolkits
matplotlib.figure.Figure.add_subplot
mpl_toolkits.mplot3d.axes3d.Axes3D.plot_surface
mpl_toolkits.mplot3d.axes3d.Axes3D.plot_wireframe
Expand Down
1 change: 0 additions & 1 deletion examples/specialty_plots/sankey_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,3 @@ def corner(sankey):
matplotlib.sankey.Sankey
matplotlib.sankey.Sankey.add
matplotlib.sankey.Sankey.finish

4 changes: 2 additions & 2 deletions examples/text_labels_and_annotations/usetex_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
xytext=(delta / 2., 0.1), textcoords='data',
arrowprops=dict(arrowstyle="<->", connectionstyle="arc3"))
plt.text(0, 0.1, r'$\delta$',
{'color': 'k', 'fontsize': 24, 'ha' : 'center', 'va' : 'center',
'bbox' : dict(boxstyle="round", fc="w", ec="k", pad=0.2)})
{'color': 'k', 'fontsize': 24, 'ha': 'center', 'va': 'center',
'bbox': dict(boxstyle="round", fc="w", ec="k", pad=0.2)})

# Use tex in labels
plt.xticks((-1, 0, 1), ('$-1$', r'$\pm 0$', '$+1$'), color='k', size=20)
Expand Down
2 changes: 1 addition & 1 deletion examples/units/basic_units.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def rad_fn(x, pos=None):
n = int((x / np.pi) * 2.0 + 0.25)
else:
n = int((x / np.pi) * 2.0 - 0.25)

if n == 0:
return '0'
elif n == 1:
Expand Down
54 changes: 27 additions & 27 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[pytest]
testpaths = lib
testpaths = lib examples
python_files = test_*.py

markers =
Expand Down Expand Up @@ -99,29 +99,29 @@ pep8ignore =
doc/* E302 E501
tutorials/* E402 E501

*examples/* E501 E402
*examples/misc/table_demo.py E201
*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/pyplots/align_ylabels.py E231
*examples/pyplots/annotate_transform.py E228 E251
*examples/pyplots/annotation_basic.py E231
*examples/pyplots/annotation_polar.py E231
*examples/pyplots/auto_subplots_adjust.py E231 E261 E302 W391
*examples/pyplots/boxplot_demo_pyplot.py E231
*examples/pyplots/compound_path_demo.py E231
*examples/pyplots/fig_axes_customize_simple.py E261
*examples/pyplots/pyplot_formatstr.py E231
*examples/pyplots/pyplot_mathtext.py E231
*examples/pyplots/pyplot_simple.py E231
*examples/pyplots/pyplot_two_subplots.py E302
*examples/pyplots/text_commands.py E231
*examples/pyplots/text_layout.py E231
*examples/pyplots/whats_new_1_subplot3d.py W391
*examples/pyplots/whats_new_98_4_fancy.py E225 E261 E302
*examples/pyplots/whats_new_98_4_fill_between.py E225
*examples/pyplots/whats_new_98_4_legend.py E228
*examples/pyplots/whats_new_99_axes_grid.py E225 E231 E302 E303
*examples/pyplots/whats_new_99_spines.py E231 E261
*examples/shapes_and_collections/artist_reference.py E203
examples/* E501 E402
examples/misc/table_demo.py E201
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/pyplots/align_ylabels.py E231
examples/pyplots/annotate_transform.py E228 E251
examples/pyplots/annotation_basic.py E231
examples/pyplots/annotation_polar.py E231
examples/pyplots/auto_subplots_adjust.py E231 E261 E302 W391
examples/pyplots/boxplot_demo_pyplot.py E231
examples/pyplots/compound_path_demo.py E231
examples/pyplots/fig_axes_customize_simple.py E261
examples/pyplots/pyplot_formatstr.py E231
examples/pyplots/pyplot_mathtext.py E231
examples/pyplots/pyplot_simple.py E231
examples/pyplots/pyplot_two_subplots.py E302
examples/pyplots/text_commands.py E231
examples/pyplots/text_layout.py E231
examples/pyplots/whats_new_1_subplot3d.py W391
examples/pyplots/whats_new_98_4_fancy.py E225 E261 E302
examples/pyplots/whats_new_98_4_fill_between.py E225
examples/pyplots/whats_new_98_4_legend.py E228
examples/pyplots/whats_new_99_axes_grid.py E225 E231 E302 E303
examples/pyplots/whats_new_99_spines.py E231 E261
examples/shapes_and_collections/artist_reference.py E203