McStasMcXtrace / McCode

The home of the McStas (neutrons) and McXtrace (x-rays) Monte-Carlo ray-tracing instrument simulation codes.
https://github.com/McStasMcXtrace/McCode/wiki
GNU General Public License v3.0
77 stars 54 forks source link

mcplot-pyqtgraph: #1398

Open farhi opened 1 year ago

farhi commented 1 year ago

It seems the current mcplot-pyqtgraph is broken on 'stable' Debian 11

mxplot-pyqtgraph /home/farhie/Downloads/Test_Fluorescence_20230118_154150
loading system configuration

q              - quit
p              - save png
s              - save svg
l              - log toggle
t              - textinfo toggle
c              - cycle colormap
F1/h           - help
F5             - replot
click          - display subplot
right-click/b  - back
ctrl + click   - sweep monitors
x              - expand subplots
Active colormap: jet
mcplot error: module 'pyqtgraph' has no attribute 'ColorBarItem'
Traceback (most recent call last):
  File "/usr/share/mcxtrace/3.1/tools/Python/mxgui/../mccodelib/../../../bin/../tools/Python/mxplot/pyqtgraph/mxplot.py", line 68, in <module>
    main(args)
  File "/usr/share/mcxtrace/3.1/tools/Python/mxgui/../mccodelib/../../../bin/../tools/Python/mxplot/pyqtgraph/mxplot.py", line 58, in main
    raise e
  File "/usr/share/mcxtrace/3.1/tools/Python/mxgui/../mccodelib/../../../bin/../tools/Python/mxplot/pyqtgraph/mxplot.py", line 52, in main
    plotter.runplot()
  File "/usr/share/mcxtrace/3.1/tools/Python/mxplot/pyqtgraph/../../mccodelib/pqtgfrontend.py", line 117, in runplot
    self.plot_node(node)
  File "/usr/share/mcxtrace/3.1/tools/Python/mxplot/pyqtgraph/../../mccodelib/pqtgfrontend.py", line 192, in plot_node
    viewbox, plt = self.add_plot(node, i, n)
  File "/usr/share/mcxtrace/3.1/tools/Python/mxplot/pyqtgraph/../../mccodelib/pqtgfrontend.py", line 425, in add_plot
    view_box, plt_itm = self.plot_func(node, i, plt, options)
  File "/usr/share/mcxtrace/3.1/tools/Python/mxplot/pyqtgraph/plotfuncs.py", line 34, in plot
    view_box, lyt = plot_Data2D(data, plt, log=opts['log'], legend=opts['legend'], icolormap=opts['icolormap'],
  File "/usr/share/mcxtrace/3.1/tools/Python/mxplot/pyqtgraph/plotfuncs.py", line 253, in plot_Data2D
    cb = pg.ColorBarItem(cmap=colormap, values=(cb_pos_min, cb_pos_max), interactive=False)
AttributeError: module 'pyqtgraph' has no attribute 'ColorBarItem'

Indeed, the ColorBarItem appeared in pyqtgraph 0.12.4 (see https://github.com/pyqtgraph/pyqtgraph/blob/master/CHANGELOG)

The installed versions on the system are:

farhi commented 1 year ago

Closed with commit 0511e61630f43c12101256d3f4779b46dbea700a