Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b26a521

Browse filesBrowse files
author
domspad
committed
pep8
1 parent 0fa4b94 commit b26a521
Copy full SHA for b26a521

File tree

Expand file treeCollapse file tree

1 file changed

+7
-5
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-5
lines changed

‎examples/pylab_examples/arrow_demo.py

Copy file name to clipboardExpand all lines: examples/pylab_examples/arrow_demo.py
+7-5Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@
99
1010
1111
"""
12-
from pylab import *
12+
import matplotlib.pyplot as plt
13+
import numpy as np
1314

14-
rates_to_bases = {'r1': 'AT', 'r2': 'TA', 'r3': 'GA', 'r4': 'AG', 'r5': 'CA', 'r6': 'AC',
15-
'r7': 'GT', 'r8': 'TG', 'r9': 'CT', 'r10': 'TC', 'r11': 'GC', 'r12': 'CG'}
15+
rates_to_bases = {'r1': 'AT', 'r2': 'TA', 'r3': 'GA', 'r4': 'AG', 'r5': 'CA',
16+
'r6': 'AC', 'r7': 'GT', 'r8': 'TG', 'r9': 'CT', 'r10': 'TC',
17+
'r11': 'GC', 'r12': 'CG'}
1618
numbered_bases_to_rates = dict([(v, k) for k, v in rates_to_bases.items()])
1719
lettered_bases_to_rates = dict([(v, 'r' + v) for k, v in rates_to_bases.items()])
1820

@@ -103,7 +105,7 @@ def make_arrow_plot(data, size=4, display='length', shape='right',
103105
}
104106

105107
def do_fontsize(k):
106-
return float(clip(max_text_size*np.sqrt(data[k]),
108+
return float(np.clip(max_text_size*np.sqrt(data[k]),
107109
min_text_size, max_text_size))
108110

109111
A = plt.text(0, 1, '$A_3$', color='r', size=do_fontsize('A'), **text_params)
@@ -204,7 +206,7 @@ def draw_arrow(pair, alpha=alpha, ec=ec, labelcolor=labelcolor):
204206
raise ValueError("Got unknown position parameter %s" % where)
205207

206208
M = np.array([[cx, sx], [-sx, cx]])
207-
coords = dot(orig_position, M) + [[x_pos, y_pos]]
209+
coords = np.dot(orig_position, M) + [[x_pos, y_pos]]
208210
x, y = np.ravel(coords)
209211
orig_label = rate_labels[pair]
210212
label = '$%s_{_{\mathrm{%s}}}$' % (orig_label[0], orig_label[1:])

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.