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