Skip to content

Commit

Permalink
Update _plot.py
Browse files Browse the repository at this point in the history
  • Loading branch information
andy6a authored Feb 6, 2024
1 parent e8b3400 commit f8bc306
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions sourcetracker/_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def ST_heatmap(self, unknowns=True, annot=True,
if not unknowns:
prop = prop.drop(['Unknown'], axis=1)
prop = prop.div(prop.sum(axis=1), axis=0)
fig, ax = plt.subplots(figsize=((prop.shape[1] * 3 / 4)+4),
fig, ax = plt.subplots(figsize=((prop.shape[1] * 3 / 4)+4,
(prop.shape[0] * 3 / 4)+4))
sns.heatmap(prop, vmin=0.0, vmax=vmax, cmap=self.color,
annot=annot, linewidths=.5, ax=ax) # ,vmax=1.0
Expand Down Expand Up @@ -133,7 +133,7 @@ def ST_paired_heatmap(self, normalized=False, unknowns=True,
axes.append("axcb")
fig, axes = plt.subplots(1, len(axes),
gridspec_kw={'width_ratios': ratios},
figsize=((prop.shape[1] * 3 / 4)+4),
figsize=((prop.shape[1] * 3 / 4)+4,
(prop.shape[0] * 3 / 4)+4))
for i in range(len(prop.columns)):
if i == 0:
Expand Down Expand Up @@ -210,12 +210,12 @@ def ST_Stacked_bar(self, unknowns=True, x_lab="Sink",
prop = prop.reset_index()
if coloring != []:
prop.plot(kind='bar', x=prop.columns[0], stacked=True,
figsize=((prop.shape[1] * 3 / 4)+4),
figsize=((prop.shape[1] * 3 / 4)+4,
(prop.shape[0] * 3 / 4)+4),
color=coloring)
else:
prop.plot(kind='bar', x=prop.columns[0], stacked=True,
figsize=((prop.shape[1] * 3 / 4)+4),
figsize=((prop.shape[1] * 3 / 4)+4,
(prop.shape[0] * 3 / 4)+4))
# plt.legend(loc=(1.05, 0.5), labelspacing=-3, frameon=True)
plt.xlabel(x_lab)
Expand Down Expand Up @@ -251,12 +251,12 @@ def ST_bar(self, unknowns=True, x_lab="Sink",
prop = prop.reset_index()
if coloring != []:
prop.plot(kind='bar', x=prop.columns[0], stacked=False,
figsize=((prop.shape[1] * 3 / 4)+4),
figsize=((prop.shape[1] * 3 / 4)+4,
(prop.shape[0] * 3 / 4 + 4)),
color=coloring)
else:
prop.plot(kind='bar', x=prop.columns[0], stacked=False,
figsize=((prop.shape[1] * 3 / 4)+4),
figsize=((prop.shape[1] * 3 / 4)+4,
(prop.shape[0] * 3 / 4 + 4)))
plt.xlabel(x_lab)
plt.ylabel(y_lab)
Expand Down

0 comments on commit f8bc306

Please sign in to comment.