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()
 
