McCode icon indicating copy to clipboard operation
McCode copied to clipboard

mcplot and polarisation SE_example* scan output don't plot with pyqtgraph

Open willend opened this issue 2 years ago • 1 comments

Traceback (most recent call last):
  File "/zhome/89/0/38697/McStas/mcstas/2.x-dev/bin/../tools/Python/mcplot/pyqtgraph/mcplot.py", line 67, in <module>
    main(args)
  File "/zhome/89/0/38697/McStas/mcstas/2.x-dev/bin/../tools/Python/mcplot/pyqtgraph/mcplot.py", line 57, in main
    raise e
  File "/zhome/89/0/38697/McStas/mcstas/2.x-dev/bin/../tools/Python/mcplot/pyqtgraph/mcplot.py", line 51, in main
    plotter.runplot()
  File "/zhome/89/0/38697/McStas/mcstas/2.x-dev/tools/Python/mcplot/pyqtgraph/../../mccodelib/pqtgfrontend.py", line 62, in runplot
    plot_node(node, self.plot_func, plt_layout, viewmodel)
  File "/zhome/89/0/38697/McStas/mcstas/2.x-dev/tools/Python/mcplot/pyqtgraph/../../mccodelib/pqtgfrontend.py", line 163, in plot_node
    vn_dict_ctrlclick[viewbox_lst[i]] = sec_lst[i]
IndexError: list index out of range

willend avatar Jun 28 '22 13:06 willend

A protection if-statement seems to fix this issue

        for i in range(len(prim_lst)):
            if (i<len(sec_lst)):
                vn_dict_ctrlclick[viewbox_lst[i]] = sec_lst[i]

willend avatar Jul 04 '22 19:07 willend