Skip to content

Commit bb2be99

Browse files
author
Peter Combs
committed
Tweaks to PlotUtils: min range, scale text
1 parent 0588665 commit bb2be99

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

PlotUtils.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,9 +320,9 @@ def svg_heatmap(data, filename, row_labels=None, box_size=4,
320320
if normer is None:
321321
norm_data = frame.copy()
322322
elif normer is 'mean':
323-
norm_data = frame.divide(frame.dropna(axis=1).mean(axis=1), axis=0)
323+
norm_data = frame.divide(frame.dropna(axis=1).mean(axis=1)+10, axis=0)
324324
elif normer is 'max':
325-
norm_data = frame.divide(frame.dropna(axis=1).max(axis=1), axis=0)
325+
norm_data = frame.divide(frame.dropna(axis=1).max(axis=1)+10, axis=0)
326326
elif normer is 'center0':
327327
norm_data = (0.5 +
328328
0.5 * frame.divide(frame.dropna(axis=1).abs().max(axis=1),
@@ -393,6 +393,8 @@ def svg_heatmap(data, filename, row_labels=None, box_size=4,
393393
col_base = col_labels[j][:col_labels[j].find(col_sep)]
394394
if col_base != prefix:
395395
prefix = col_base
396+
if cmap_by_prefix:
397+
c_cmap = cmap_by_prefix(prefix)
396398
g.add(dwg.line((x_start + box_size * j,
397399
y_start + i * box_height),
398400
(x_start + box_size * j,
@@ -433,6 +435,8 @@ def svg_heatmap(data, filename, row_labels=None, box_size=4,
433435
if draw_row_labels:
434436
for i in range(rows):
435437
dwg.add(dwg.text(row_labels[i],
436-
(x_start, y_start + i*box_height+box_height),))
438+
(x_start, y_start + i*box_height+box_height),
439+
style='font-size:{}'.format(box_height),
440+
))
437441
pbar.finish()
438442
dwg.saveas(filename)

0 commit comments

Comments
 (0)