浏览代码

g.gui.tplot: fixed bug with strds and csv output

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@72529 15284696-431f-4ddb-bdfa-cd5b030d7da7
Luca Delucchi 7 年之前
父节点
当前提交
38b1cc996f
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      gui/wxpython/tplot/frame.py

+ 2 - 2
gui/wxpython/tplot/frame.py

@@ -647,7 +647,7 @@ class TplotFrame(wx.Frame):
     def _writeCSV(self, x, y):
     def _writeCSV(self, x, y):
         """Used to write CSV file of plotted data"""
         """Used to write CSV file of plotted data"""
         import csv
         import csv
-        if len(y) > 1:
+        if isinstance(y[0], list):
             zipped = zip(x, *y)
             zipped = zip(x, *y)
         else:
         else:
             zipped = zip(x, y)
             zipped = zip(x, y)
@@ -661,6 +661,7 @@ class TplotFrame(wx.Frame):
         
         
     def drawR(self):
     def drawR(self):
         ycsv = []
         ycsv = []
+        xcsv = []
         for i, name in enumerate(self.datasetsR):
         for i, name in enumerate(self.datasetsR):
             name = name[0]
             name = name[0]
             # just name; with mapset it would be long
             # just name; with mapset it would be long
@@ -668,7 +669,6 @@ class TplotFrame(wx.Frame):
             self.yticksPos.append(1)  # TODO
             self.yticksPos.append(1)  # TODO
             xdata = []
             xdata = []
             ydata = []
             ydata = []
-            xcsv = []
             for keys, values in self.timeDataR[name].iteritems():
             for keys, values in self.timeDataR[name].iteritems():
                 if keys in ['temporalType', 'granularity', 'validTopology',
                 if keys in ['temporalType', 'granularity', 'validTopology',
                             'unit', 'temporalDataType']:
                             'unit', 'temporalDataType']: