Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Title (and font properties) + frame removal #13

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion scTDA/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import json
import matplotlib_venn
import matplotlib.pyplot as plt
import networkx
import numexpr
import numpy
Expand Down Expand Up @@ -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):
"""
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 == '':
Expand Down