Bug #4104
plotting error in Throughput
Start date:
06/14/2013
Due date:
% Done:
0%
Estimated time:
Description
This is a really weird bug and I couldn't figure it out. It occurs when a new figure is created in plot_line (l. 1060). WTF?
========================= entering Throughput ========================= ... imported data ... Combined minor optical elements ... Combined major optical elements with galaxy, including aperture losses ... computed final throughput ... exported data to databank ... basic diagnostic plots fig_number: 1 fig_number: 1 fig_number: 1 bad plot; throughput spectrum --------------------------------------------------------------------------- TypeError Traceback (most recent call last) /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/IPython/utils/py3compat.pyc in execfile(fname, *where) 176 else: 177 filename = fname --> 178 __builtin__.execfile(filename, *where) /Users/ben/Documents/DESpec/repo/despec/04-Throughput/CalculateThroughput_Nord/CalculateThroughput.py in <module>() 154 #------------------------------- 155 if __name__ == '__main__': --> 156 main() 157 158 /Users/ben/Documents/DESpec/repo/despec/04-Throughput/CalculateThroughput_Nord/CalculateThroughput.py in main() 147 def main(): 148 --> 149 throughput() 150 print 151 print /Users/ben/Documents/DESpec/repo/despec/04-Throughput/CalculateThroughput_Nord/CalculateThroughput.py in throughput() 131 fig_number=1, plot_number=0, title='', base_directory='.', filename_addendum="", 132 show_plot=show_plot, --> 133 file_type=plot_image_file_type 134 ) 135 except (RuntimeError, TypeError, NameError): /Users/ben/Documents/DESpec/repo/despec/Plotters_New/Plotters_New.pyc in plot_line(center, hist, width, center1, hist1, width1, center2, hist2, width2, center3, hist3, width3, xmin, xmax, ymin, ymax, yrelmin, yrelmax, rotation, plot_type, color_bar, color_list, textx_loc, texty_loc, mytext, linewidth, scaling_x, scaling_y, title, xlabel, ylabel, label_legend, label_legend1, label_legend2, labels_xtick, fig_height, fig_name, base_directory, filename_addendum, file_type, choose_remove_file, fig_number, plot_number, show_plot) 1058 1059 print "fig_number:", fig_number -> 1060 fig = pylab.figure(fig_number) 1061 file_figure_out = base_directory+"/Figures/"+fig_name+"_"+str(plot_number)+"."+file_type 1062 /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/pyplot.pyc in figure(num, figsize, dpi, facecolor, edgecolor, frameon, FigureClass, **kwargs) 341 frameon=frameon, 342 FigureClass=FigureClass, --> 343 **kwargs) 344 345 if figLabel: /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/backends/backend_macosx.pyc in new_figure_manager(num, *args, **kwargs) 241 "Python as a framework on Mac OS X") 242 FigureClass = kwargs.pop('FigureClass', Figure) --> 243 figure = FigureClass(*args, **kwargs) 244 return new_figure_manager_given_figure(num, figure) 245 /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/figure.pyc in __init__(self, figsize, dpi, facecolor, edgecolor, linewidth, frameon, subplotpars, tight_layout) 302 self.dpi_scale_trans = Affine2D() 303 self.dpi = dpi --> 304 self.bbox_inches = Bbox.from_bounds(0, 0, *figsize) 305 self.bbox = TransformedBbox(self.bbox_inches, self.dpi_scale_trans) 306 /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/transforms.pyc in from_bounds(x0, y0, width, height) 784 *width* and *height* may be negative. 785 """ --> 786 return Bbox.from_extents(x0, y0, x0 + width, y0 + height) 787 788 @staticmethod TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'