Problems exporting graphs from GUI

104 views
Skip to first unread message

Alejandro Condori

unread,
Oct 22, 2017, 3:42:24 PM10/22/17
to pyqtgraph
Hi, i was trying to export a graph from a QGraphicsView (promoted to PlotWidget with pyqtgraph as header file) but I had some troubles doing that. Spyder returns this error:
 
TypeError: 'float' object cannot be interpreted as an integer

So, I found the file where the problem was and made a change in line 70 of the file "ImageExporte.py" located in this directory: C:\ProgramData\Anaconda3\Lib\site-packages\pyqtgraph\exporters :

line 70 before:  bg = np.empty((self.params['width'], self.params['height'], 4), dtype=np.ubyte)

line 70 after:     bg = np.empty((int(self.params['width']), int(self.params['height']), 4), dtype=np.ubyte)

And the problem was solved, I didn't know where do I have to report this, so i posted this here 

陳冠任

unread,
Apr 5, 2018, 1:06:41 AM4/5/18
to pyqtgraph
Thanks bro, I encounter same problem!

Alejandro Condori

unread,
Apr 15, 2018, 2:50:40 PM4/15/18
to pyqtgraph
Did it work? 

陳冠任

unread,
Apr 15, 2018, 11:05:14 PM4/15/18
to pyqtgraph
yeah, it's work great.

adityahahoo

unread,
Apr 16, 2018, 8:06:10 AM4/16/18
to pyqtgraph
Hi Alejandro!

In my opinion, since you have found how to solve the issue, you can initiate the change to PyQtGraph's Github code repository by creating a pull request here:

There are links on the page which help contributors posting a pull request for the first time. 
Aditya
Reply all
Reply to author
Forward
0 new messages