|
9 | 9 |
|
10 | 10 |
|
11 | 11 | """
|
12 |
| -from pylab import * |
| 12 | +import matplotlib.pyplot as plt |
| 13 | +import numpy as np |
13 | 14 |
|
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'} |
16 | 18 | numbered_bases_to_rates = dict([(v, k) for k, v in rates_to_bases.items()])
|
17 | 19 | lettered_bases_to_rates = dict([(v, 'r' + v) for k, v in rates_to_bases.items()])
|
18 | 20 |
|
@@ -103,7 +105,7 @@ def make_arrow_plot(data, size=4, display='length', shape='right',
|
103 | 105 | }
|
104 | 106 |
|
105 | 107 | 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]), |
107 | 109 | min_text_size, max_text_size))
|
108 | 110 |
|
109 | 111 | 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):
|
204 | 206 | raise ValueError("Got unknown position parameter %s" % where)
|
205 | 207 |
|
206 | 208 | 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]] |
208 | 210 | x, y = np.ravel(coords)
|
209 | 211 | orig_label = rate_labels[pair]
|
210 | 212 | label = '$%s_{_{\mathrm{%s}}}$' % (orig_label[0], orig_label[1:])
|
|
0 commit comments