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

Error when trying to export plot. #22

Open
nicomeza opened this issue Jan 20, 2020 · 1 comment
Open

Error when trying to export plot. #22

nicomeza opened this issue Jan 20, 2020 · 1 comment

Comments

@nicomeza
Copy link

When using the option to save the plot (Export -> Plot -> Image file) the program crashes without saving the plots.
The error output :

Traceback (most recent call last):
File "/home/dustspeck/miniconda3/lib/python3.7/site-packages/pyqtgraph/exporters/Exporter.py", line 77, in fileSaveFinished
self.export(fileName=fileName, **self.fileDialog.opts)
File "/home/dustspeck/miniconda3/lib/python3.7/site-packages/pyqtgraph/exporters/ImageExporter.py", line 70, in export
bg = np.empty((self.params['width'], self.params['height'], 4), dtype=np.ubyte)

TypeError: 'float' object cannot be interpreted as an integer

When trying to export with the option 'Matplotlib Window' it also crashes.

Error output :


Traceback (most recent call last):
File "/home/dustspeck/miniconda3/lib/python3.7/site-packages/pyqtgraph/GraphicsScene/exportDialog.py", line 132, in exportClicked
self.currentExporter.export()
File "/home/dustspeck/miniconda3/lib/python3.7/site-packages/pyqtgraph/exporters/Matplotlib.py", line 109, in export
raise Exception("Matplotlib export currently only works with plot items")
Exception: Matplotlib export currently only works with plot items

When selecting the 'Entire scene' instead of 'Plot', saving in image format and SVG seems to work fine.

@daniel-muthukrishna
Copy link
Owner

Thank you for making me aware of this error and for suggesting a workaround. I will try to release a fix to this and add a save_plot routine in the next update.
For now, the following should work as you suggest:

To save a plot:
Right-click the plot, click Export, select Entire Scene, select Image File or SVG, and save the plot appropriately.

To save the data from the plot:
Right-click the plot, click Export, select CSV from plot data, and save the data appropriately.

Of course, you can make your own plots with the saved data, or using the python interface.

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

No branches or pull requests

2 participants