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

PyQTGraph ImageExporter bug related to image size #722

Closed
ParisNeo opened this issue Jul 11, 2018 · 2 comments
Closed

PyQTGraph ImageExporter bug related to image size #722

ParisNeo opened this issue Jul 11, 2018 · 2 comments

Comments

@ParisNeo
Copy link

Hi,

I am using pyqtgraph to produce plots in a PyQT window. I want to export PNG image of the graphs.

I have this error when I try to export my plots:

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

I noticed that the self.params['width'] and self.params['height'] are floats. But np.empty can not create an erray using float sizes.

Even if i set the width and height manually using :

exporter.parameters()['width'] = self.raw_DataPlot.width()
exporter.parameters()['height'] = self.raw_DataPlot.height()
The results are floats.

I noticed that If I change the line 70 of ImageExporter.py to :

bg = np.empty((int(self.params['width']), int(self.params['height']), 4),dtype=np.ubyte)
The export works fine.

Is it possible to address this issue and update the library?

Thanks

@campagnola
Copy link
Member

Hi @ParisNeo, this issue is already fixed and will be in the 0.11 release.

@ParisNeo
Copy link
Author

ParisNeo commented Aug 3, 2018

Thanks alot.

I did make a workaround since then. I created my own exporter and placed it in my project. It is 100% complient with the ImageExporter so it would be easy for me to move back to the original one.

Thanks alot

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