Changeset 6477
- Timestamp:
- Mar 10, 2009, 10:26:25 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
misc/tools/plotcsv/plotcsv.py
r6358 r6477 162 162 def error(msg): 163 163 print msg 164 import tkinter_error 165 tkinter_error.tkinter_error(msg) 164 166 sys.exit(10) 165 167 … … 167 169 ################################################################################ 168 170 # An object that behaves like a dictionary but is pickled/unpickled from a file. 171 # Used to save state in the application. 169 172 ################################################################################ 170 173 … … 279 282 del data[0] # get rid of header in dataset 280 283 284 # ensure header strings don't have leading/trailing spaces 285 new_header = [] 286 for h in header: 287 new_header.append(h.strip()) 288 header = new_header 289 281 290 # get int index values for column headers 282 291 try: 283 292 x_index = header.index(x_hdr) 284 293 except ValueError: 285 error("Sorry, X column header '%s' isn't in the data file." % x_hdr) 294 error("Sorry, X column header '%s' isn't in data file '%s'." 295 % (x_hdr, filename)) 286 296 287 297 try: 288 298 y_index = header.index(y_hdr) 289 299 except ValueError: 290 error("Sorry, Y column header '%s' isn't in the data file." % y_hdr) 300 error("Sorry, Y column header '%s' isn't in data file '%s'." 301 % (y_hdr, filename)) 291 302 292 303 # get appropriate columns from data[] … … 329 340 legend_names = [os.path.basename(x) for x in filenames] 330 341 pylab.legend(legend_names, 'upper right') 331 # pylab.legend(legend_names, 'upper left')332 342 333 343 pylab.show() 334 #pylab.close()344 pylab.close() 335 345 336 346
Note: See TracChangeset
for help on using the changeset viewer.