You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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.
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:
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
The text was updated successfully, but these errors were encountered: