Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plotting on ubuntu (silx error) #47

Closed
cwgaldino opened this issue Mar 15, 2021 · 2 comments
Closed

Plotting on ubuntu (silx error) #47

cwgaldino opened this issue Mar 15, 2021 · 2 comments

Comments

@cwgaldino
Copy link

I have tried to use crispy 0.7.3 on Ubuntu 20.04, but got the following error when plotting spectra:

Traceback (most recent call last):
  File "/home/galdino/envs/my_env/lib/python3.8/site-packages/silx/gui/plot/backends/BackendBase.py", line 343, in postRedisplay
    plot.replot()
  File "/home/galdino/envs/my_env/lib/python3.8/site-packages/silx/gui/plot/PlotWidget.py", line 2949, in replot
    item._update(self._backend)
  File "/home/galdino/envs/my_env/lib/python3.8/site-packages/silx/gui/plot/items/core.py", line 442, in _update
    self._backendRenderer = self._addBackendRenderer(backend)
  File "/home/galdino/envs/my_env/lib/python3.8/site-packages/silx/gui/plot/items/curve.py", line 199, in _addBackendRenderer
    return backend.addCurve(xFiltered, yFiltered,
TypeError: addCurve() missing 1 required positional argument: 'legend'
Aborted (core dumped)

Then I used the following workaround:

  1. Edit line 199 of curve.py in the silx package (the full file path can be found in error message above).

Before it was

return backend.addCurve(xFiltered, yFiltered,

and I changed it to

return backend.addCurve(xFiltered, yFiltered, legend='',

Note that this "breaks" the silxs installation within that environment. Particularly, I have separated environment just for running crispy 0.7.3.

  1. Edit line 58 of plot.py in the crispy folder (<crispy_folder>/crispy/gui/plot.py)

Before it was

x, y, legend, *args, **kwargs)

and I changed it to

x, y, *args, **kwargs)

You may close this. I just thought it would be a good idea to report this error here since other people might also have the same issue when using crispy on ubuntu.

@mretegan
Copy link
Owner

mretegan commented Mar 16, 2021

Thanks a lot for reporting this. The plotting API changed in the more recent silx versions. Another way to solve the issue is to install an older version of silx.

python3 -m pip install silx==0.11

The issue here is that older versions of silx don't provide wheels, so pip will compile the library from the source, which might not be too much of a problem on Linux.

I'll update the README.rst to reflect this. Hopefully, I will finish the new release soon.

@mretegan
Copy link
Owner

Fixed in version 0.8.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants