Ignore:
Timestamp:
Jan 29, 2009, 9:59:17 AM (15 years ago)
Author:
rwilson
Message:

Removed dependency on matplotlib.pyplot.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • misc/tools/plotcsv/plotcsv.py

    r6235 r6238  
    99import time
    1010import getopt
    11 import matplotlib.pyplot as plt
     11try:
     12    import pylab
     13except:
     14    print 'Sorry, you have to install python-matplotlib'
     15    sys.exit(10)
    1216
    1317
     
    3741# @param options A dictionary of plot options.
    3842def plot_data(x_data, y_data, options):
    39     plt.plot(x_data, y_data)  # x, y
    40     plt.title(options.get(TITLE, ''))
    41     plt.grid(True)
     43    pylab.plot(x_data, y_data)  # x, y
     44    pylab.title(options.get(TITLE, ''))
     45    pylab.grid(True)
    4246
    4347    # if user request a particular Y range
     
    4953        except:
    5054            error('Sorry, got a bad value for Y range: %s' % options[Y_RANGE])
    51         plt.ylim(ymin=minimum, ymax=maximum)
     55        pylab.ylim(ymin=minimum, ymax=maximum)
    5256
    53     plt.xlabel(options.get(X_LABEL, ''))
    54     plt.ylabel(options.get(Y_LABEL, ''))
     57    pylab.xlabel(options.get(X_LABEL, ''))
     58    pylab.ylabel(options.get(Y_LABEL, ''))
    5559
    56     plt.show()
     60    pylab.show()
    5761
    5862
     
    166170
    167171    # 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.