Figure size in plots

Thu, 05 Oct 2017 14:18:42 +0300

author
Iannis <ulalume3@yahoo.com>
date
Thu, 05 Oct 2017 14:18:42 +0300
changeset 77
8ea07d18abc2
parent 73
6c06efef397c
child 78
2515c87b8451

Figure size in plots

atmospheric_lidar/generic.py file | annotate | diff | comparison | revisions
--- a/atmospheric_lidar/generic.py	Sat Sep 09 11:25:42 2017 +0300
+++ b/atmospheric_lidar/generic.py	Thu Oct 05 14:18:42 2017 +0300
@@ -592,13 +592,14 @@
         prof = np.mean(self.matrix, axis=0)
         return prof
 
-    def plot(self, signal_type='rc', filename=None, zoom=[0, 12000, 0, -1], show_plot=True, cmap=plt.cm.jet, z0=None,
+    def plot(self, figsize=(8, 4), signal_type='rc', zoom=[0, 12000, 0, -1], show_plot=True, cmap=plt.cm.jet, z0=None,
              title=None, vmin=0, vmax=1.3 * 10 ** 7):
         # if filename is not None:
         #    matplotlib.use('Agg')
 
-        fig = plt.figure()
+        fig = plt.figure(figsize=figsize)
         ax1 = fig.add_subplot(111)
+
         self.draw_plot(ax1, cmap=cmap, signal_type=signal_type, zoom=zoom, z0=z0, vmin=vmin, vmax=vmax)
 
         if title:
@@ -606,13 +607,8 @@
         else:
             ax1.set_title("%s signal - %s" % (signal_type.upper(), self.name))
 
-        if filename is not None:
-            pass
-            # plt.savefig(filename)
-        else:
-            if show_plot:
-                plt.show()
-                # plt.close() ???
+        if show_plot:
+            plt.show()
 
     def draw_plot(self, ax1, cmap=plt.cm.jet, signal_type='rc',
                   zoom=[0, 12000, 0, -1], z0=None,

mercurial