Changeset 13074 for fact/tools/pyscripts/pyfact/plotters.py
- Timestamp:
- 03/12/12 16:32:11 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/tools/pyscripts/pyfact/plotters.py
r13019 r13074 8 8 import numpy as np 9 9 import matplotlib.pyplot as plt 10 import os.path 11 import sys 10 12 11 13 class Plotter(object): … … 76 78 def __init__(self, name, ion=True, grid=True, fname=None, map_file_path = '../map_dn.txt', vmin=None, vmax=None): 77 79 """ initialize the object """ 80 path = os.path.abspath(__file__) 81 path = os.path.dirname(path) 82 map_file_path = os.path.join(path, map_file_path) 83 if not os.path.isfile(map_file_path): 84 print 'not able to find file:', map_file_path 85 sys.exit(-2) 86 78 87 self.name = name 79 80 88 if ion: 81 89 plt.ion() … … 142 150 if ydata.ndim > 1: 143 151 ydata = ydata.flatten() 144 145 plt.hist(ydata, bins, range, label=label, log=log)146 152 if label: 153 plt.hist(ydata, bins, range, label=label, log=log) 147 154 plt.legend() 155 else: 156 plt.hist(ydata, bins, range, log=log) 157 148 158 plt.title(self.name) 149 159
Note:
See TracChangeset
for help on using the changeset viewer.