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

Skip to content

Commit 0130bb9

Browse files
committed
pep8 fix E502 (redundant backslash)
1 parent b081c92 commit 0130bb9

File tree

4 files changed

+25
-25
lines changed

4 files changed

+25
-25
lines changed

examples/images_contours_and_fields/interpolation_none_vs_nearest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
big_im_path = cbook.get_sample_data('necked_tensile_specimen.png')
2020
big_im = plt.imread(big_im_path)
2121
# Define small image
22-
small_im = np.array([[0.25, 0.75, 1.0, 0.75], [0.1, 0.65, 0.5, 0.4], \
22+
small_im = np.array([[0.25, 0.75, 1.0, 0.75], [0.1, 0.65, 0.5, 0.4],
2323
[0.6, 0.3, 0.0, 0.2], [0.7, 0.9, 0.4, 0.6]])
2424

2525
# Create a 2x2 table of plots
@@ -32,7 +32,7 @@
3232
ax.imshow(small_im, interpolation='none')
3333
ax = plt.subplot(2, 2, 4)
3434
ax.imshow(small_im, interpolation='nearest')
35-
plt.subplots_adjust(left=0.24, wspace=0.2, hspace=0.1, \
35+
plt.subplots_adjust(left=0.24, wspace=0.2, hspace=0.1,
3636
bottom=0.05, top=0.86)
3737

3838
# Label the rows and columns of the table

examples/pylab_examples/arrow_demo.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"""
1212
from pylab import *
1313

14-
rates_to_bases = {'r1': 'AT', 'r2': 'TA', 'r3': 'GA', 'r4': 'AG', 'r5': 'CA', 'r6': 'AC', \
14+
rates_to_bases = {'r1': 'AT', 'r2': 'TA', 'r3': 'GA', 'r4': 'AG', 'r5': 'CA', 'r6': 'AC',
1515
'r7': 'GT', 'r8': 'TG', 'r9': 'CT', 'r10': 'TC', 'r11': 'GC', 'r12': 'CG'}
1616
numbered_bases_to_rates = dict([(v, k) for k, v in rates_to_bases.items()])
1717
lettered_bases_to_rates = dict([(v, 'r' + v) for k, v in rates_to_bases.items()])
@@ -24,10 +24,10 @@ def add_dicts(d1, d2):
2424
return result
2525

2626

27-
def make_arrow_plot(data, size=4, display='length', shape='right', \
28-
max_arrow_width=0.03, arrow_sep=0.02, alpha=0.5, \
29-
normalize_data=False, ec=None, labelcolor=None, \
30-
head_starts_at_zero=True, rate_labels=lettered_bases_to_rates,\
27+
def make_arrow_plot(data, size=4, display='length', shape='right',
28+
max_arrow_width=0.03, arrow_sep=0.02, alpha=0.5,
29+
normalize_data=False, ec=None, labelcolor=None,
30+
head_starts_at_zero=True, rate_labels=lettered_bases_to_rates,
3131
**kwargs):
3232
"""Makes an arrow plot.
3333
@@ -53,11 +53,11 @@ def make_arrow_plot(data, size=4, display='length', shape='right', \
5353
max_text_size = size*12
5454
min_text_size = size
5555
label_text_size = size*2.5
56-
text_params = {'ha': 'center', 'va': 'center', 'family': 'sans-serif',\
56+
text_params = {'ha': 'center', 'va': 'center', 'family': 'sans-serif',
5757
'fontweight': 'bold'}
5858
r2 = sqrt(2)
5959

60-
deltas = {\
60+
deltas = {
6161
'AT': (1, 0),
6262
'TA': (-1, 0),
6363
'GA': (0, 1),
@@ -72,7 +72,7 @@ def make_arrow_plot(data, size=4, display='length', shape='right', \
7272
'CG': (-1, 0)
7373
}
7474

75-
colors = {\
75+
colors = {
7676
'AT': 'r',
7777
'TA': 'k',
7878
'GA': 'g',
@@ -87,7 +87,7 @@ def make_arrow_plot(data, size=4, display='length', shape='right', \
8787
'CG': 'b'
8888
}
8989

90-
label_positions = {\
90+
label_positions = {
9191
'AT': 'center',
9292
'TA': 'center',
9393
'GA': 'center',
@@ -103,7 +103,7 @@ def make_arrow_plot(data, size=4, display='length', shape='right', \
103103
}
104104

105105
def do_fontsize(k):
106-
return float(clip(max_text_size*sqrt(data[k]),\
106+
return float(clip(max_text_size*sqrt(data[k]),
107107
min_text_size, max_text_size))
108108

109109
A = text(0, 1, '$A_3$', color='r', size=do_fontsize('A'), **text_params)
@@ -117,7 +117,7 @@ def do_fontsize(k):
117117
max_arrow_width = max_arrow_width
118118
max_head_width = 2.5*max_arrow_width
119119
max_head_length = 2*max_arrow_width
120-
arrow_params = {'length_includes_head': True, 'shape': shape, \
120+
arrow_params = {'length_includes_head': True, 'shape': shape,
121121
'head_starts_at_zero': head_starts_at_zero}
122122
ax = gca()
123123
sf = 0.6 # max arrow size represents this in data coords
@@ -126,7 +126,7 @@ def do_fontsize(k):
126126
r2v = arrow_sep/r2 # offset for diags
127127

128128
# tuple of x, y for start position
129-
positions = {\
129+
positions = {
130130
'AT': (arrow_h_offset, 1 + arrow_sep),
131131
'TA': (1 - arrow_h_offset, 1 - arrow_sep),
132132
'GA': (-arrow_sep, arrow_h_offset),
@@ -179,8 +179,8 @@ def draw_arrow(pair, alpha=alpha, ec=ec, labelcolor=labelcolor):
179179

180180
x_scale, y_scale = deltas[pair]
181181
x_pos, y_pos = positions[pair]
182-
arrow(x_pos, y_pos, x_scale*length, y_scale*length, \
183-
fc=fc, ec=ec, alpha=alpha, width=width, head_width=head_width, \
182+
arrow(x_pos, y_pos, x_scale*length, y_scale*length,
183+
fc=fc, ec=ec, alpha=alpha, width=width, head_width=head_width,
184184
head_length=head_length, **arrow_params)
185185

186186
# figure out coordinates for text
@@ -209,14 +209,14 @@ def draw_arrow(pair, alpha=alpha, ec=ec, labelcolor=labelcolor):
209209
orig_label = rate_labels[pair]
210210
label = '$%s_{_{\mathrm{%s}}}$' % (orig_label[0], orig_label[1:])
211211

212-
text(x, y, label, size=label_text_size, ha='center', va='center', \
212+
text(x, y, label, size=label_text_size, ha='center', va='center',
213213
color=labelcolor or fc)
214214

215215
for p in positions.keys():
216216
draw_arrow(p)
217217

218218
# test data
219-
all_on_max = dict([(i, 1) for i in 'TCAG'] + \
219+
all_on_max = dict([(i, 1) for i in 'TCAG'] +
220220
[(i + j, 0.6) for i in 'TCAG' for j in 'TCAG'])
221221

222222
realistic_data = {

examples/pylab_examples/line_collection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
# See matplotlib.collections.LineCollection for more information
3333
line_segments = LineCollection(segs,
3434
linewidths=(0.5, 1, 1.5, 2),
35-
colors = [colorConverter.to_rgba(i) \
35+
colors = [colorConverter.to_rgba(i)
3636
for i in ('b', 'g', 'r', 'c', 'm', 'y', 'k')],
3737
linestyle = 'solid')
3838
ax.add_collection(line_segments)

examples/user_interfaces/fourier_demo_wx.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,16 @@ def __init__(self, *args, **kwargs):
9999
wx.Frame.__init__(self, *args, **kwargs)
100100

101101
self.fourierDemoWindow = FourierDemoWindow(self)
102-
self.frequencySliderGroup = SliderGroup(self, label='Frequency f0:', \
102+
self.frequencySliderGroup = SliderGroup(self, label='Frequency f0:',
103103
param=self.fourierDemoWindow.f0)
104-
self.amplitudeSliderGroup = SliderGroup(self, label=' Amplitude a:', \
104+
self.amplitudeSliderGroup = SliderGroup(self, label=' Amplitude a:',
105105
param=self.fourierDemoWindow.A)
106106

107107
sizer = wx.BoxSizer(wx.VERTICAL)
108108
sizer.Add(self.fourierDemoWindow, 1, wx.EXPAND)
109-
sizer.Add(self.frequencySliderGroup.sizer, 0, \
109+
sizer.Add(self.frequencySliderGroup.sizer, 0,
110110
wx.EXPAND | wx.ALIGN_CENTER | wx.ALL, border=5)
111-
sizer.Add(self.amplitudeSliderGroup.sizer, 0, \
111+
sizer.Add(self.amplitudeSliderGroup.sizer, 0,
112112
wx.EXPAND | wx.ALIGN_CENTER | wx.ALL, border=5)
113113
self.SetSizer(sizer)
114114

@@ -183,9 +183,9 @@ def draw(self):
183183
self.subplot1.set_ylim([0, 1])
184184
self.subplot2.set_xlim([-2, 2])
185185
self.subplot2.set_ylim([-2, 2])
186-
self.subplot1.text(0.05, .95, r'$X(f) = \mathcal{F}\{x(t)\}$', \
186+
self.subplot1.text(0.05, .95, r'$X(f) = \mathcal{F}\{x(t)\}$',
187187
verticalalignment='top', transform=self.subplot1.transAxes)
188-
self.subplot2.text(0.05, .95, r'$x(t) = a \cdot \cos(2\pi f_0 t) e^{-\pi t^2}$', \
188+
self.subplot2.text(0.05, .95, r'$x(t) = a \cdot \cos(2\pi f_0 t) e^{-\pi t^2}$',
189189
verticalalignment='top', transform=self.subplot2.transAxes)
190190

191191
def compute(self, f0, A):

0 commit comments

Comments
 (0)