Discussion:
[pyqtgraph] Bug in ImageExporter.py
Lior Weintraub
2018-09-12 17:41:46 UTC
Permalink
Hi,

I am using python 3.6 on Windows and running pyqtgraph version 0.10.0.
When using image exporter according this
<http://www.pyqtgraph.org/documentation/exporting.html> example I got
exception on ImageExplorer.py line 70:

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

Note that only the concept was copied from the example and was applied on
my plot which had different distentions.
The exception was caused because height was a float number.
I saw in code that aspect ratio is kept so I change the width dimension so
the height would be an integer.
Even then, the height was set to float.
In my example the width was 3000 and the height was calculated as 1750.0
Finally, when nothing worked I patched the code and changed line 70 to:

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

If you think this needs to be fixed in a differently, please share your
thoughts.

Best regards,
Lior.
--
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 pyqtgraph+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/1bb097ca-fc3d-4f41-94f5-862e0ee991dd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Patrick
2018-09-13 03:39:17 UTC
Permalink
Yes, that is an issue with the 0.10 release. It's fixed if you get the
latest version from the git repository.
Post by Lior Weintraub
Hi,
I am using python 3.6 on Windows and running pyqtgraph version 0.10.0.
When using image exporter according this
<http://www.pyqtgraph.org/documentation/exporting.html> example I got
bg = np.empty((self.params['width'], self.params['height'], 4),
dtype=np.ubyte)
Note that only the concept was copied from the example and was applied on
my plot which had different distentions.
The exception was caused because height was a float number.
I saw in code that aspect ratio is kept so I change the width dimension so
the height would be an integer.
Even then, the height was set to float.
In my example the width was 3000 and the height was calculated as 1750.0
bg = np.empty((int(self.params['width']), int(
self.params['height']), 4), dtype=np.ubyte)
If you think this needs to be fixed in a differently, please share your
thoughts.
Best regards,
Lior.
--
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 pyqtgraph+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/8a738845-3049-40e4-adb4-ca4429abe6ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Lior Weintraub
2018-09-13 05:48:20 UTC
Permalink
Thanks.
Post by Patrick
Yes, that is an issue with the 0.10 release. It's fixed if you get the
latest version from the git repository.
Post by Lior Weintraub
Hi,
I am using python 3.6 on Windows and running pyqtgraph version 0.10.0.
When using image exporter according this
<http://www.pyqtgraph.org/documentation/exporting.html> example I got
bg = np.empty((self.params['width'], self.params['height'], 4),
dtype=np.ubyte)
Note that only the concept was copied from the example and was applied on
my plot which had different distentions.
The exception was caused because height was a float number.
I saw in code that aspect ratio is kept so I change the width dimension
so the height would be an integer.
Even then, the height was set to float.
In my example the width was 3000 and the height was calculated as 1750.0
bg = np.empty((int(self.params['width']), int(
self.params['height']), 4), dtype=np.ubyte)
If you think this needs to be fixed in a differently, please share your
thoughts.
Best regards,
Lior.
--
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
To view this discussion on the web visit
https://groups.google.com/d/msgid/pyqtgraph/8a738845-3049-40e4-adb4-ca4429abe6ff%40googlegroups.com
<https://groups.google.com/d/msgid/pyqtgraph/8a738845-3049-40e4-adb4-ca4429abe6ff%40googlegroups.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 pyqtgraph+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/CAFmXaQr8N-ZS0d%3DgzrC2N7JpT-0NNCo%3DFwn7igTxmH9naiXqOA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Loading...