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

Skip to content

Commit af30544

Browse files
author
anykraus
committed
pep8 compliance
Ran pep8.py 1.5.6 (https://github.com/jcrocholl/pep8) over the code. Fixed all complaints.
1 parent 07930c0 commit af30544

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

lib/matplotlib/backends/qt4_editor/figureoptions.py

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818
from matplotlib.backends.qt4_compat import QtGui
1919
from matplotlib import markers
2020

21+
2122
def get_icon(name):
2223
import matplotlib
2324
basedir = osp.join(matplotlib.rcParams['datapath'], 'images')
2425
return QtGui.QIcon(osp.join(basedir, name))
2526

26-
LINESTYLES = {
27-
'-': 'Solid',
27+
LINESTYLES = {'-': 'Solid',
2828
'--': 'Dashed',
2929
'-.': 'DashDot',
3030
':': 'Dotted',
@@ -34,9 +34,10 @@ def get_icon(name):
3434

3535
MARKERS = markers.MarkerStyle.markers
3636

37+
3738
def figure_edit(axes, parent=None):
3839
"""Edit matplotlib figure options"""
39-
sep = (None, None) # separator
40+
sep = (None, None) # separator
4041

4142
has_curve = len(axes.get_lines()) > 0
4243

@@ -53,9 +54,9 @@ def figure_edit(axes, parent=None):
5354
(None, "<b>Y-Axis</b>"),
5455
('Min', ymin), ('Max', ymax),
5556
('Label', axes.get_ylabel()),
56-
('Scale', [axes.get_yscale(), 'linear', 'log'])
57+
('Scale', [axes.get_yscale(), 'linear', 'log']),
5758
sep,
58-
('(Re-)Generate automatic legend', False) #defaults to False, as it clobbers carefully hand crafted legends /2014-04-22
59+
('(Re-)Generate automatic legend', False),
5960
]
6061

6162
if has_curve:
@@ -72,8 +73,7 @@ def figure_edit(axes, parent=None):
7273
curvelabels = sorted(linedict.keys())
7374
for label in curvelabels:
7475
line = linedict[label]
75-
curvedata = [
76-
('Label', label),
76+
curvedata = [('Label', label),
7777
sep,
7878
(None, '<b>Line</b>'),
7979
('Style', [line.get_linestyle()] + linestyles),
@@ -100,7 +100,8 @@ def apply_callback(data):
100100
general, = data
101101

102102
# Set / General
103-
title, xmin, xmax, xlabel, xscale, ymin, ymax, ylabel, yscale, generate_legend = general #/2014-04-22
103+
title, xmin, xmax, xlabel, xscale, ymin, ymax, ylabel, yscale, \
104+
generate_legend = general
104105
axes.set_xscale(xscale)
105106
axes.set_yscale(yscale)
106107
axes.set_title(title)
@@ -114,7 +115,8 @@ def apply_callback(data):
114115
for index, curve in enumerate(curves):
115116
line = linedict[curvelabels[index]]
116117
label, linestyle, linewidth, color, \
117-
marker, markersize, markerfacecolor, markeredgecolor = curve
118+
marker, markersize, markerfacecolor, markeredgecolor \
119+
= curve
118120
line.set_label(label)
119121
line.set_linestyle(linestyle)
120122
line.set_linewidth(linewidth)
@@ -124,12 +126,12 @@ def apply_callback(data):
124126
line.set_markersize(markersize)
125127
line.set_markerfacecolor(markerfacecolor)
126128
line.set_markeredgecolor(markeredgecolor)
127-
128-
# re-generate legend, if checkbox is checked. Stefan Kraus/tacaswell 2014-04-22
129+
130+
# re-generate legend, if checkbox is checked
129131
if generate_legend:
130132
if axes.legend_ is not None:
131133
old_legend = axes.get_legend()
132-
new_legend = axes.legend(ncol = old_legend._ncol)
134+
new_legend = axes.legend(ncol=old_legend._ncol)
133135
new_legend.draggable(old_legend._draggable is not None)
134136
else:
135137
new_legend = axes.legend()
@@ -140,6 +142,7 @@ def apply_callback(data):
140142
figure.canvas.draw()
141143

142144
data = formlayout.fedit(datalist, title="Figure options", parent=parent,
143-
icon=get_icon('qt4_editor_options.svg'), apply=apply_callback)
145+
icon=get_icon('qt4_editor_options.svg'),
146+
apply=apply_callback)
144147
if data is not None:
145148
apply_callback(data)

0 commit comments

Comments
 (0)