Skip to content

Style-fix some examples and update .flake8 per-file-ignores. #16427

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 1 commit into from
Feb 6, 2020
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
27 changes: 13 additions & 14 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ per-file-ignores =

examples/animation/frame_grabbing_sgskip.py: E402
examples/axes_grid1/inset_locator_demo.py: E402
examples/axes_grid1/scatter_hist_locatable_axes.py: E401, 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
Expand Down Expand Up @@ -178,32 +178,31 @@ per-file-ignores =
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: E228, E251, E402
examples/pyplots/annotate_transform.py: E251, E402
examples/pyplots/annotation_basic.py: E402
examples/pyplots/annotation_polar.py: E231, E402
examples/pyplots/auto_subplots_adjust.py: E231, E302, E402
examples/pyplots/annotation_polar.py: E402
examples/pyplots/auto_subplots_adjust.py: E302, E402
examples/pyplots/axline.py: E402
examples/pyplots/boxplot_demo_pyplot.py: E231, E402
examples/pyplots/compound_path_demo.py: E231
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: E231, E402
examples/pyplots/pyplot_mathtext.py: E231, E402
examples/pyplots/pyplot_formatstr.py: E402
examples/pyplots/pyplot_mathtext.py: E402
examples/pyplots/pyplot_scales.py: E402
examples/pyplots/pyplot_simple.py: E231, 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: E231, E402
examples/pyplots/text_layout.py: E231, 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: E225, E402
examples/pyplots/whats_new_98_4_legend.py: E228, 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: E231, 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
Expand Down
3 changes: 2 additions & 1 deletion examples/axes_grid1/scatter_hist_locatable_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@
# The use of the following functions, methods and classes is shown
# in this example:

import matplotlib, mpl_toolkits
import matplotlib
import mpl_toolkits
mpl_toolkits.axes_grid1.axes_divider.make_axes_locatable
matplotlib.axes.Axes.set_aspect
matplotlib.axes.Axes.scatter
Expand Down
2 changes: 1 addition & 1 deletion examples/pyplots/text_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
ax.set_ylabel('ylabel')

ax.text(3, 8, 'boxed italics text in data coords', style='italic',
bbox={'facecolor':'red', 'alpha':0.5, 'pad':10})
bbox={'facecolor': 'red', 'alpha': 0.5, 'pad': 10})

ax.text(2, 6, r'an equation: $E=mc^2$', fontsize=15)

Expand Down
4 changes: 2 additions & 2 deletions examples/pyplots/whats_new_98_4_fill_between.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

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.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()
Expand Down
2 changes: 1 addition & 1 deletion examples/pyplots/whats_new_98_4_legend.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
ax = plt.subplot(111)
t1 = np.arange(0.0, 1.0, 0.01)
for n in [1, 2, 3, 4]:
plt.plot(t1, t1**n, label="n=%d"%(n,))
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)
Expand Down