1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
Description: Change figsize with new matplotlib
Author: Nilesh Patra <nilesh@debian.org>
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1027169
Last-Update: 2022-12-29
--- a/poretools/occupancy.py
+++ b/poretools/occupancy.py
@@ -42,11 +42,13 @@
df = pd.DataFrame(d)
d = df.pivot("rownum", "colnum", "tot_reads")
+ if args.saveas is not None:
+ plt.figure(figsize=(8.5,8.5))
sns.heatmap(d, annot=True, fmt="d", linewidths=.5)
if args.saveas is not None:
plot_file = args.saveas
- plt.savefig(plot_file, figsize=(8.5, 8.5))
+ plt.savefig(plot_file)
else:
plt.show()
--- a/poretools/yield_plot.py
+++ b/poretools/yield_plot.py
@@ -51,6 +51,8 @@
sns.set_style("whitegrid")
# plot
+ if args.saveas is not None:
+ plt.figure(figsize=(8.5,8.5))
plt.plot(df['start'], df['cumul'])
plt.xlabel('Time (hours)')
plt.ylabel(y_label)
@@ -58,7 +60,7 @@
if args.saveas is not None:
plot_file = args.saveas
- plt.savefig(plot_file, figsize=(8.5, 8.5))
+ plt.savefig(plot_file)
else:
plt.show()
|