It works! Thanks.

François

On 02/10/2017 05:33 AM, [email protected] wrote:
> quick fix:
> change *ImageExporter.py*:
> *bg = np.empty((self.params['width'], self.params['height'], 4),
> dtype=np.ubyte)*
> to:
> *bg = np.empty((int(self.params['width']), int(self.params['height']),
> 4), dtype=np.ubyte)*
> 
> On Thu, Feb 9, 2017 at 11:40 AM, François <[email protected]
> <mailto:[email protected]>> wrote:
> 
>     Dear all,
> 
>     I recently updated pyqtgraph from 0.9 to 0.10 and now have a problem
>     with the exporter.
> 
>     The same bug appears in the example code given in the documentation:
>     http://www.pyqtgraph.org/documentation/exporting.html
>     <http://www.pyqtgraph.org/documentation/exporting.html>
> 
>     This is what I get:
>     Python 2.7.12 (default, Nov 19 2016, 06:48:10)
>     [GCC 5.4.0 20160609] on linux2
>     Type "help", "copyright", "credits" or "license" for more information.
>     >>> import pyqtgraph as pg
>     >>> import pyqtgraph.exporters
>     >>> plt = pg.plot([1,5,2,4,3])
>     >>> exporter = pg.exporters.ImageExporter(plt.plotItem)
>     >>> exporter.parameters()['width'] = 100
>     >>> exporter.export('fileName.png')
>     Traceback (most recent call last):
>       File "<stdin>", line 1, in <module>
>       File
>     
> "/usr/local/lib/python2.7/dist-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 index
> 
>     Best
>     François
> 
>     -- 
>     You received this message because you are subscribed to the Google
>     Groups "pyqtgraph" group.
>     To unsubscribe from this group and stop receiving emails from it,
>     send an email to [email protected]
>     <mailto:[email protected]>.
>     To view this discussion on the web visit
>     
> https://groups.google.com/d/msgid/pyqtgraph/f8558f05-4cad-4438-9ce6-fa51b5f3c973%40googlegroups.com
>     
> <https://groups.google.com/d/msgid/pyqtgraph/f8558f05-4cad-4438-9ce6-fa51b5f3c973%40googlegroups.com?utm_medium=email&utm_source=footer>.
>     For more options, visit https://groups.google.com/d/optout
>     <https://groups.google.com/d/optout>.
> 
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "pyqtgraph" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to [email protected]
> <mailto:[email protected]>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pyqtgraph/CAD_qyJoUO8C8ur%2BaPDMXBrmnJ7VCTbQ-zpA5ZSE8xk6VM4rX3A%40mail.gmail.com
> <https://groups.google.com/d/msgid/pyqtgraph/CAD_qyJoUO8C8ur%2BaPDMXBrmnJ7VCTbQ-zpA5ZSE8xk6VM4rX3A%40mail.gmail.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyqtgraph/411ae7e5-322c-d673-2974-7dd18731ef6a%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to