Changeset 6238
- Timestamp:
- Jan 29, 2009, 9:59:17 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
misc/tools/plotcsv/plotcsv.py
r6235 r6238 9 9 import time 10 10 import getopt 11 import matplotlib.pyplot as plt 11 try: 12 import pylab 13 except: 14 print 'Sorry, you have to install python-matplotlib' 15 sys.exit(10) 12 16 13 17 … … 37 41 # @param options A dictionary of plot options. 38 42 def plot_data(x_data, y_data, options): 39 p lt.plot(x_data, y_data) # x, y40 p lt.title(options.get(TITLE, ''))41 p lt.grid(True)43 pylab.plot(x_data, y_data) # x, y 44 pylab.title(options.get(TITLE, '')) 45 pylab.grid(True) 42 46 43 47 # if user request a particular Y range … … 49 53 except: 50 54 error('Sorry, got a bad value for Y range: %s' % options[Y_RANGE]) 51 p lt.ylim(ymin=minimum, ymax=maximum)55 pylab.ylim(ymin=minimum, ymax=maximum) 52 56 53 p lt.xlabel(options.get(X_LABEL, ''))54 p lt.ylabel(options.get(Y_LABEL, ''))57 pylab.xlabel(options.get(X_LABEL, '')) 58 pylab.ylabel(options.get(Y_LABEL, '')) 55 59 56 p lt.show()60 pylab.show() 57 61 58 62 … … 166 170 167 171 # plot the file 168 plot_file( args[0], opt_dict)172 plot_file(filename, opt_dict)
Note: See TracChangeset
for help on using the changeset viewer.