[GRASS-SVN] r68122 - grass/trunk/gui/wxpython/tplot

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Mar 23 07:35:37 PDT 2016


Author: lucadelu
Date: 2016-03-23 07:35:37 -0700 (Wed, 23 Mar 2016)
New Revision: 68122

Modified:
   grass/trunk/gui/wxpython/tplot/g.gui.tplot.py
Log:
g.gui.tplot: add capabilities to save figure  more formats

Modified: grass/trunk/gui/wxpython/tplot/g.gui.tplot.py
===================================================================
--- grass/trunk/gui/wxpython/tplot/g.gui.tplot.py	2016-03-23 14:06:48 UTC (rev 68121)
+++ grass/trunk/gui/wxpython/tplot/g.gui.tplot.py	2016-03-23 14:35:37 UTC (rev 68122)
@@ -78,10 +78,10 @@
     options, flags = gscript.parser()
 
     import wx
-    
+
     from grass.script.setup import set_gui_path
     set_gui_path()
-    
+
     from core.utils import _
     from core.giface import StandaloneGrassInterface
     try:
@@ -121,12 +121,7 @@
             sizes = options['size'].strip().split(',')
             sizes = [int(s) for s in sizes]
             frame.canvas.SetSize(sizes)
-        if output.split('.')[-1].lower() == 'png':
-            frame.canvas.print_png(output)
-        if output.split('.')[-1].lower() in ['jpg', 'jpeg']:
-            frame.canvas.print_jpg(output)
-        if output.split('.')[-1].lower() in ['tif', 'tiff']:
-            frame.canvas.print_tif(output)
+        frame.canvas.figure.savefig(output)
     else:
         frame.Show()
         app.MainLoop()



More information about the grass-commit mailing list