Describe the bug
As reported through the sasview help email list, exporting graphics to SVG format fails with the error No module named 'matplotlib.backends.backend_svg'. This isn't the only mpl backend missing, but jpeg, png, and raw all work. Most others fail.
Important Note: All mpl backends are included in the pypi and conda packages, so this only fails in the distributables.
To Reproduce
Steps to reproduce the behavior:
- Open a plot.
- Click on the save icon.
- Select
Scalable Vector Graphics (*.svg *.svgz).
- See error
Expected behavior
The files should be saved in SVG format.
SasView version (please complete the following information):
- Version: v6.0.1, v6.1.0, v6.1.1, v6.1.2
Operating system (please complete the following information):
- OS: Windows 11, MacOS (ARM)
Installation method (please complete the following information):
- Installed: Windows installer, MacOS application
Additional context
Matplotlib hooks need to be explicitly specified in the .spec file to be integrated into the final build. See https://pyinstaller.org/en/stable/hooks.html#PyInstaller.utils.hooks.get_hook_config. We could use the matplotlib.use() at the top of our plotting routines to list all required backends. Also, we could specify all hooks be installed, but we would need to test how much larger the installer becomes.
If the backend isn't specified as used or in the spec file, they won't be bundled in the final build.
Describe the bug
As reported through the sasview help email list, exporting graphics to SVG format fails with the error
No module named 'matplotlib.backends.backend_svg'. This isn't the only mpl backend missing, but jpeg, png, and raw all work. Most others fail.Important Note: All mpl backends are included in the pypi and conda packages, so this only fails in the distributables.
To Reproduce
Steps to reproduce the behavior:
Scalable Vector Graphics (*.svg *.svgz).Expected behavior
The files should be saved in SVG format.
SasView version (please complete the following information):
Operating system (please complete the following information):
Installation method (please complete the following information):
Additional context
Matplotlib hooks need to be explicitly specified in the
.specfile to be integrated into the final build. See https://pyinstaller.org/en/stable/hooks.html#PyInstaller.utils.hooks.get_hook_config. We could use thematplotlib.use()at the top of our plotting routines to list all required backends. Also, we could specifyallhooks be installed, but we would need to test how much larger the installer becomes.If the backend isn't specified as used or in the spec file, they won't be bundled in the final build.