diff --git a/scTDA/main.py b/scTDA/main.py index e30d99f..968800f 100644 --- a/scTDA/main.py +++ b/scTDA/main.py @@ -13,6 +13,7 @@ import json import matplotlib_venn +import matplotlib.pyplot as plt import networkx import numexpr import numpy @@ -42,6 +43,11 @@ GLOBAL METHODS """ +def _remove_frame(ax): + plt.setp(ax.spines.values(), linewidth=0) + ax.set_xticks([]) + ax.set_yticks([]) + def ParseAyasdiGraph(name, source, lab, user, password): """ @@ -1190,7 +1196,8 @@ def adjacency_matrix(self, lista, ind=1, verbose=False): return numpy.array(mat) def draw(self, color, connected=True, labels=False, ccmap='jet', weight=8.0, save='', ignore_log=False, - table=False, axis=[], a=0.4, dpi=None, figsize=None, lw=1.0): + table=False, axis=[], a=0.4, dpi=None, figsize=None, lw=1.0, title=None, + font_props={'fontname': 'Arial'}, remove_frame=False): """ Displays topological representation of the data colored according to the expression of a gene, genes or list of genes, specified by argument 'color'. This can be a gene or a list of one, two or three genes or lists @@ -1336,6 +1343,10 @@ def draw(self, color, connected=True, labels=False, ccmap='jet', weight=8.0, sav rowColours=['r', 'g', 'b'], colWidths=[0.08] * 7) the_table.scale(1.787, 1) pylab.subplots_adjust(bottom=0.2) + if title is not None: + plt.title(title, **font_props) + if remove_frame: + _remove_frame(plt.gca()) if len(axis) == 4: pylab.axis(axis) if save == '':