achim1 / muonic

A python gui for QNet DAQ card experiments
http://achim1.github.io/muonic/
1 stars 9 forks source link

Muonic doesn't start on SL6 with matplotlib 1.4.2 #47

Closed hpbretz closed 9 years ago

hpbretz commented 9 years ago

I checked out release 2 and started bin/muonic -s xx. The packages named in the documentation are all installed.

Error message

[wgs00] ~/scripts/muonic % ./muonic.py -s HP                                                     git: [release2] .
INFO:19809:MainWindow:__init__:173:Timewindow is 5.00
/afs/ifh.de/group/amanda/software_test/RHEL_6.0_amd64/python-tools/lib/python2.7/site-packages/matplotlib/backends/backend_qt5agg.py:210: MatplotlibDeprecationWarning: This class has been deprecated in 1.4 as it has no additional functionality over `NavigationToolbar2QT`.  Please change your code to use `NavigationToolbar2QT` instead
  mplDeprecation)
Traceback (most recent call last):
  File "./muonic.py", line 103, in <module>
    main(opts,logger)
  File "./muonic.py", line 49, in main
    gui=MainWindow(client, logger, opts)
  File "/afs/ifh.de/user/h/hpbretz/scripts/muonic/muonic/gui/MainWindow.py", line 178, in __init__
    self.tabwidget.addTab(PulseanalyzerWidget(logger,parent = self),"Pulse Analyzer")
  File "/afs/ifh.de/user/h/hpbretz/scripts/muonic/muonic/gui/MuonicWidgets.py", line 322, in __init__
    self.pulsewidthcanvas = PulseWidthCanvas(self,logger)
  File "/afs/ifh.de/user/h/hpbretz/scripts/muonic/muonic/gui/MuonicPlotCanvases.py", line 380, in __init__
    MuonicHistCanvas.__init__(self,parent,logger,n.linspace(0.,100,30),histcolor=histcolor,xmin=0.,xmax=100,ymin=0,ymax=2,ylabel="Events",xlabel="Pulse Width (ns)") 
  File "/afs/ifh.de/user/h/hpbretz/scripts/muonic/muonic/gui/MuonicPlotCanvases.py", line 268, in __init__
    self.bincontent   = self.ax.hist(n.array([]), self.binning, fc=histcolor, alpha=0.25)[0]
  File "/afs/ifh.de/group/amanda/software_test/RHEL_6.0_amd64/python-tools/lib/python2.7/site-packages/matplotlib/axes/_axes.py", line 5571, in hist
    raise ValueError("x must have at least one data point")
ValueError: x must have at least one data point
hpbretz commented 9 years ago

This happens because of lines like self.bincontent = self.ax.hist(n.array([]), self.binning, fc=histcolor, alpha=0.25)[0]

which try to create an empty matplotlib histogram, which doesn't work in recent matplotlib versions.

hpbretz commented 9 years ago

Closed in c9bb174e524c60f1c1143158ed63b0a23255d975