Discussion:
[pyqtgraph] Difference between outputs PySide/PyQt4 on windows
dhabbyc
2018-07-05 19:05:21 UTC
Permalink
Hello,

I'm a little bit confused: i have a windows OS and both PySide (1.2.4) and
PyQt4 installed.

When I run the "histogram" example just as it is, pyqtgraph chooses pyqt4,
and the histogram look like expected:



<Loading Image...>


But when I use PySide, this is the result:


<Loading Image...>


When I click and drag the image, the plot appears, but no axes:


<Loading Image...>



Is this a bug or I'm doing something wrong.


This is the script I'm using:


*# -*- coding: utf-8 -*-*

*"""*

*In this example we draw two different kinds of histogram.*

*"""*

*#import initExample ## Add path to library (just for examples; you do not
need this)*


*#import PySide*

*import pyqtgraph as pg*

*from pyqtgraph.Qt import QtCore, QtGui, USE_PYSIDE, USE_PYQT4*

*import numpy as np*


*print pg.USE_PYSIDE, pg.USE_PYQT4*


*win = pg.GraphicsWindow()*

*win.resize(800,350)*

*win.setWindowTitle('pyqtgraph example: Histogram')*

*plt1 = win.addPlot()*

*#plt2 = win.addPlot()*


*## make interesting distribution of values*

*vals = np.hstack([np.random.normal(size=500), np.random.normal(size=260,
loc=4)])*


*## compute standard histogram*

*y,x = np.histogram(vals, bins=np.linspace(-3, 8, 40))*


*## Using stepMode=True causes the plot to draw two lines for each sample.*

*## notice that len(x) == len(y)+1*

*plt1.plot(x, y, stepMode=True, fillLevel=0, brush=(0,0,255,150))*


*## Now draw all points as a nicely-spaced scatter plot*

*#y = pg.pseudoScatter(vals, spacing=0.15)*

*#plt2.plot(vals, y, pen=None, symbol='o', symbolSize=5)*

*#plt2.plot(vals, y, pen=None, symbol='o', symbolSize=5,
symbolPen=(255,255,255,200), symbolBrush=(0,0,255,150))*


*## Start Qt event loop unless running in interactive mode or using pyside.*

*if __name__ == '__main__':*

* import sys*

* if (sys.flags.interactive != 1) or not hasattr(QtCore,
'PYQT_VERSION'):*

* QtGui.QApplication.instance().exec_()*



Could someone help me please?
--
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/5c68ea89-11de-46ec-9cbd-41847d988cf8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Luke Campagnola
2018-07-07 06:34:54 UTC
Permalink
This is just a guess, but I think this may be related to using scaling /
high DPI in windows, and I think it may have been fixed already. Could you
try the latest code from the develop branch on github?
Post by dhabbyc
Hello,
I'm a little bit confused: i have a windows OS and both PySide (1.2.4)
and PyQt4 installed.
When I run the "histogram" example just as it is, pyqtgraph chooses
<https://lh3.googleusercontent.com/-AK-MZzfP-kw/Wz5qwhyUeuI/AAAAAAAAAdk/nDSCR4gOrwk3rd4fr8aLGMtl0idbnFxWACLcBGAs/s1600/hist1.png>
<https://lh3.googleusercontent.com/-JSonMheh9nc/Wz5rHjI0TzI/AAAAAAAAAds/CMCd-aI8pTozWVBlr1z3YVFM5KXOdpsRwCLcBGAs/s1600/hist2.png>
<https://lh3.googleusercontent.com/-xJ_lNiZRTZ0/Wz5reLMaqGI/AAAAAAAAAd0/bsZVp-IyZVYDBtoL9ZRTjQaCOTvzd1qhACLcBGAs/s1600/hist3.png>
Is this a bug or I'm doing something wrong.
*# -*- coding: utf-8 -*-*
*"""*
*In this example we draw two different kinds of histogram.*
*"""*
*#import initExample ## Add path to library (just for examples; you do not
need this)*
*#import PySide*
*import pyqtgraph as pg*
*from pyqtgraph.Qt import QtCore, QtGui, USE_PYSIDE, USE_PYQT4*
*import numpy as np*
*print pg.USE_PYSIDE, pg.USE_PYQT4*
*win = pg.GraphicsWindow()*
*win.resize(800,350)*
*win.setWindowTitle('pyqtgraph example: Histogram')*
*plt1 = win.addPlot()*
*#plt2 = win.addPlot()*
*## make interesting distribution of values*
*vals = np.hstack([np.random.normal(size=500), np.random.normal(size=260,
loc=4)])*
*## compute standard histogram*
*y,x = np.histogram(vals, bins=np.linspace(-3, 8, 40))*
*## Using stepMode=True causes the plot to draw two lines for each sample.*
*## notice that len(x) == len(y)+1*
*plt1.plot(x, y, stepMode=True, fillLevel=0, brush=(0,0,255,150))*
*## Now draw all points as a nicely-spaced scatter plot*
*#y = pg.pseudoScatter(vals, spacing=0.15)*
*#plt2.plot(vals, y, pen=None, symbol='o', symbolSize=5)*
*#plt2.plot(vals, y, pen=None, symbol='o', symbolSize=5,
symbolPen=(255,255,255,200), symbolBrush=(0,0,255,150))*
*## Start Qt event loop unless running in interactive mode or using pyside.*
*if __name__ == '__main__':*
* import sys*
* if (sys.flags.interactive != 1) or not hasattr(QtCore,
'PYQT_VERSION'):*
* QtGui.QApplication.instance().exec_()*
Could someone help me please?
--
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/5c68ea89-11de-46ec-9cbd-41847d988cf8%40googlegroups.com
<https://groups.google.com/d/msgid/pyqtgraph/5c68ea89-11de-46ec-9cbd-41847d988cf8%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/CACZXET8kaL2PfQMcigze3N4Lk9tLjBjvy7EBHiEa%2B7Xst4OMXQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Diego Mancilla
2018-07-07 21:29:18 UTC
Permalink
Hello Luke,

Thank you for your answers. I will try what you suggest. I'll let you know.

d.
Post by Luke Campagnola
This is just a guess, but I think this may be related to using scaling /
high DPI in windows, and I think it may have been fixed already. Could you
try the latest code from the develop branch on github?
Post by dhabbyc
Hello,
I'm a little bit confused: i have a windows OS and both PySide (1.2.4)
and PyQt4 installed.
When I run the "histogram" example just as it is, pyqtgraph chooses
<https://lh3.googleusercontent.com/-AK-MZzfP-kw/Wz5qwhyUeuI/AAAAAAAAAdk/nDSCR4gOrwk3rd4fr8aLGMtl0idbnFxWACLcBGAs/s1600/hist1.png>
<https://lh3.googleusercontent.com/-JSonMheh9nc/Wz5rHjI0TzI/AAAAAAAAAds/CMCd-aI8pTozWVBlr1z3YVFM5KXOdpsRwCLcBGAs/s1600/hist2.png>
<https://lh3.googleusercontent.com/-xJ_lNiZRTZ0/Wz5reLMaqGI/AAAAAAAAAd0/bsZVp-IyZVYDBtoL9ZRTjQaCOTvzd1qhACLcBGAs/s1600/hist3.png>
Is this a bug or I'm doing something wrong.
*# -*- coding: utf-8 -*-*
*"""*
*In this example we draw two different kinds of histogram.*
*"""*
*#import initExample ## Add path to library (just for examples; you do
not need this)*
*#import PySide*
*import pyqtgraph as pg*
*from pyqtgraph.Qt import QtCore, QtGui, USE_PYSIDE, USE_PYQT4*
*import numpy as np*
*print pg.USE_PYSIDE, pg.USE_PYQT4*
*win = pg.GraphicsWindow()*
*win.resize(800,350)*
*win.setWindowTitle('pyqtgraph example: Histogram')*
*plt1 = win.addPlot()*
*#plt2 = win.addPlot()*
*## make interesting distribution of values*
*vals = np.hstack([np.random.normal(size=500), np.random.normal(size=260,
loc=4)])*
*## compute standard histogram*
*y,x = np.histogram(vals, bins=np.linspace(-3, 8, 40))*
*## Using stepMode=True causes the plot to draw two lines for each sample.*
*## notice that len(x) == len(y)+1*
*plt1.plot(x, y, stepMode=True, fillLevel=0, brush=(0,0,255,150))*
*## Now draw all points as a nicely-spaced scatter plot*
*#y = pg.pseudoScatter(vals, spacing=0.15)*
*#plt2.plot(vals, y, pen=None, symbol='o', symbolSize=5)*
*#plt2.plot(vals, y, pen=None, symbol='o', symbolSize=5,
symbolPen=(255,255,255,200), symbolBrush=(0,0,255,150))*
*## Start Qt event loop unless running in interactive mode or using pyside.*
*if __name__ == '__main__':*
* import sys*
* if (sys.flags.interactive != 1) or not hasattr(QtCore,
'PYQT_VERSION'):*
* QtGui.QApplication.instance().exec_()*
Could someone help me please?
--
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/5c68ea89-11de-46ec-9cbd-41847d988cf8%40googlegroups.com
<https://groups.google.com/d/msgid/pyqtgraph/5c68ea89-11de-46ec-9cbd-41847d988cf8%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
To view this discussion on the web visit
https://groups.google.com/d/msgid/pyqtgraph/CACZXET8kaL2PfQMcigze3N4Lk9tLjBjvy7EBHiEa%2B7Xst4OMXQ%40mail.gmail.com
<https://groups.google.com/d/msgid/pyqtgraph/CACZXET8kaL2PfQMcigze3N4Lk9tLjBjvy7EBHiEa%2B7Xst4OMXQ%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 pyqtgraph+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/CAKzfFORyLQNCoYHd72WSxQ0934vwjx5%3DhqXD6jc0AtSmAx-F4w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Diego Mancilla
2018-07-11 13:32:43 UTC
Permalink
Hello Luke,

I've downloaded and installed the branch from git. Now, using PySide, the
"out of scope" initial problem is solved (the histogram is correclty shown
-centered- on the plot window), but still no axes.

[image: hist1.png]
​

Do you have another idea?
Post by Diego Mancilla
Hello Luke,
Thank you for your answers. I will try what you suggest. I'll let you know.
d.
Post by Luke Campagnola
This is just a guess, but I think this may be related to using scaling /
high DPI in windows, and I think it may have been fixed already. Could you
try the latest code from the develop branch on github?
Post by dhabbyc
Hello,
I'm a little bit confused: i have a windows OS and both PySide (1.2.4)
and PyQt4 installed.
When I run the "histogram" example just as it is, pyqtgraph chooses
<https://lh3.googleusercontent.com/-AK-MZzfP-kw/Wz5qwhyUeuI/AAAAAAAAAdk/nDSCR4gOrwk3rd4fr8aLGMtl0idbnFxWACLcBGAs/s1600/hist1.png>
<https://lh3.googleusercontent.com/-JSonMheh9nc/Wz5rHjI0TzI/AAAAAAAAAds/CMCd-aI8pTozWVBlr1z3YVFM5KXOdpsRwCLcBGAs/s1600/hist2.png>
<https://lh3.googleusercontent.com/-xJ_lNiZRTZ0/Wz5reLMaqGI/AAAAAAAAAd0/bsZVp-IyZVYDBtoL9ZRTjQaCOTvzd1qhACLcBGAs/s1600/hist3.png>
Is this a bug or I'm doing something wrong.
*# -*- coding: utf-8 -*-*
*"""*
*In this example we draw two different kinds of histogram.*
*"""*
*#import initExample ## Add path to library (just for examples; you do
not need this)*
*#import PySide*
*import pyqtgraph as pg*
*from pyqtgraph.Qt import QtCore, QtGui, USE_PYSIDE, USE_PYQT4*
*import numpy as np*
*print pg.USE_PYSIDE, pg.USE_PYQT4*
*win = pg.GraphicsWindow()*
*win.resize(800,350)*
*win.setWindowTitle('pyqtgraph example: Histogram')*
*plt1 = win.addPlot()*
*#plt2 = win.addPlot()*
*## make interesting distribution of values*
*vals = np.hstack([np.random.normal(size=500),
np.random.normal(size=260, loc=4)])*
*## compute standard histogram*
*y,x = np.histogram(vals, bins=np.linspace(-3, 8, 40))*
*## Using stepMode=True causes the plot to draw two lines for each sample.*
*## notice that len(x) == len(y)+1*
*plt1.plot(x, y, stepMode=True, fillLevel=0, brush=(0,0,255,150))*
*## Now draw all points as a nicely-spaced scatter plot*
*#y = pg.pseudoScatter(vals, spacing=0.15)*
*#plt2.plot(vals, y, pen=None, symbol='o', symbolSize=5)*
*#plt2.plot(vals, y, pen=None, symbol='o', symbolSize=5,
symbolPen=(255,255,255,200), symbolBrush=(0,0,255,150))*
*## Start Qt event loop unless running in interactive mode or using pyside.*
*if __name__ == '__main__':*
* import sys*
* if (sys.flags.interactive != 1) or not hasattr(QtCore,
'PYQT_VERSION'):*
* QtGui.QApplication.instance().exec_()*
Could someone help me please?
--
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
To view this discussion on the web visit
https://groups.google.com/d/msgid/pyqtgraph/5c68ea89-11de-46ec-9cbd-41847d988cf8%40googlegroups.com
<https://groups.google.com/d/msgid/pyqtgraph/5c68ea89-11de-46ec-9cbd-41847d988cf8%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
To view this discussion on the web visit
https://groups.google.com/d/msgid/pyqtgraph/CACZXET8kaL2PfQMcigze3N4Lk9tLjBjvy7EBHiEa%2B7Xst4OMXQ%40mail.gmail.com
<https://groups.google.com/d/msgid/pyqtgraph/CACZXET8kaL2PfQMcigze3N4Lk9tLjBjvy7EBHiEa%2B7Xst4OMXQ%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 pyqtgraph+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/CAKzfFOQc__hnv23fdD1tnoTOK0hHxEB--QchzwnbOEAh3F85Jg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Luke Campagnola
2018-07-11 15:48:41 UTC
Permalink
I don't have any other ideas at the moment. I will see if I can find a
windows machine + high DPI + PySide to test on.
Meanwhile, can you post the output of pg.systemInfo() ?
Post by Diego Mancilla
Hello Luke,
I've downloaded and installed the branch from git. Now, using PySide, the
"out of scope" initial problem is solved (the histogram is correclty shown
-centered- on the plot window), but still no axes.
[image: hist1.png]
​
Do you have another idea?
Post by Diego Mancilla
Hello Luke,
Thank you for your answers. I will try what you suggest. I'll let you know.
d.
Post by Luke Campagnola
This is just a guess, but I think this may be related to using scaling /
high DPI in windows, and I think it may have been fixed already. Could you
try the latest code from the develop branch on github?
Post by dhabbyc
Hello,
I'm a little bit confused: i have a windows OS and both PySide (1.2.4)
and PyQt4 installed.
When I run the "histogram" example just as it is, pyqtgraph chooses
<https://lh3.googleusercontent.com/-AK-MZzfP-kw/Wz5qwhyUeuI/AAAAAAAAAdk/nDSCR4gOrwk3rd4fr8aLGMtl0idbnFxWACLcBGAs/s1600/hist1.png>
<https://lh3.googleusercontent.com/-JSonMheh9nc/Wz5rHjI0TzI/AAAAAAAAAds/CMCd-aI8pTozWVBlr1z3YVFM5KXOdpsRwCLcBGAs/s1600/hist2.png>
<https://lh3.googleusercontent.com/-xJ_lNiZRTZ0/Wz5reLMaqGI/AAAAAAAAAd0/bsZVp-IyZVYDBtoL9ZRTjQaCOTvzd1qhACLcBGAs/s1600/hist3.png>
Is this a bug or I'm doing something wrong.
*# -*- coding: utf-8 -*-*
*"""*
*In this example we draw two different kinds of histogram.*
*"""*
*#import initExample ## Add path to library (just for examples; you do
not need this)*
*#import PySide*
*import pyqtgraph as pg*
*from pyqtgraph.Qt import QtCore, QtGui, USE_PYSIDE, USE_PYQT4*
*import numpy as np*
*print pg.USE_PYSIDE, pg.USE_PYQT4*
*win = pg.GraphicsWindow()*
*win.resize(800,350)*
*win.setWindowTitle('pyqtgraph example: Histogram')*
*plt1 = win.addPlot()*
*#plt2 = win.addPlot()*
*## make interesting distribution of values*
*vals = np.hstack([np.random.normal(size=500),
np.random.normal(size=260, loc=4)])*
*## compute standard histogram*
*y,x = np.histogram(vals, bins=np.linspace(-3, 8, 40))*
*## Using stepMode=True causes the plot to draw two lines for each sample.*
*## notice that len(x) == len(y)+1*
*plt1.plot(x, y, stepMode=True, fillLevel=0, brush=(0,0,255,150))*
*## Now draw all points as a nicely-spaced scatter plot*
*#y = pg.pseudoScatter(vals, spacing=0.15)*
*#plt2.plot(vals, y, pen=None, symbol='o', symbolSize=5)*
*#plt2.plot(vals, y, pen=None, symbol='o', symbolSize=5,
symbolPen=(255,255,255,200), symbolBrush=(0,0,255,150))*
*## Start Qt event loop unless running in interactive mode or using pyside.*
*if __name__ == '__main__':*
* import sys*
* if (sys.flags.interactive != 1) or not hasattr(QtCore,
'PYQT_VERSION'):*
* QtGui.QApplication.instance().exec_()*
Could someone help me please?
--
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
To view this discussion on the web visit https://groups.google.com/d/
msgid/pyqtgraph/5c68ea89-11de-46ec-9cbd-41847d988cf8%40googlegroups.com
<https://groups.google.com/d/msgid/pyqtgraph/5c68ea89-11de-46ec-9cbd-41847d988cf8%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
To view this discussion on the web visit https://groups.google.com/d/
msgid/pyqtgraph/CACZXET8kaL2PfQMcigze3N4Lk9tLjBjvy7EBHiEa%2B7Xst4OMXQ%
40mail.gmail.com
<https://groups.google.com/d/msgid/pyqtgraph/CACZXET8kaL2PfQMcigze3N4Lk9tLjBjvy7EBHiEa%2B7Xst4OMXQ%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
To view this discussion on the web visit https://groups.google.com/d/
msgid/pyqtgraph/CAKzfFOQc__hnv23fdD1tnoTOK0hHxEB--
QchzwnbOEAh3F85Jg%40mail.gmail.com
<https://groups.google.com/d/msgid/pyqtgraph/CAKzfFOQc__hnv23fdD1tnoTOK0hHxEB--QchzwnbOEAh3F85Jg%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 pyqtgraph+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/CACZXET-imUorswbkGhtLFp8Wqj7VbRq%3Dr_vW9ouKC4sb0wXNqw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Diego Mancilla
2018-07-11 15:51:57 UTC
Permalink
Thank you Luke,

Here is what you requested:

*sys.platform: win32*
*sys.version: 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:25:58) [MSC
v.1500 64 bit (AMD64)]*
*qt bindings: PySide 1.2.4 Qt 4.8.7*
*pyqtgraph: 0.11.0.dev0+ga240766; None*
*config:*
*{'antialias': False,*
* 'background': 'k',*
* 'crashWarning': False,*
* 'editorCommand': None,*
* 'enableExperimental': False,*
* 'exitCleanup': True,*
* 'foreground': 'd',*
* 'imageAxisOrder': 'col-major',*
* 'leftButtonPan': True,*
* 'useOpenGL': False,*
* 'useWeave': False,*
* 'weaveDebug': False}*
*None*

Regards.
Post by Luke Campagnola
I don't have any other ideas at the moment. I will see if I can find a
windows machine + high DPI + PySide to test on.
Meanwhile, can you post the output of pg.systemInfo() ?
Post by Diego Mancilla
Hello Luke,
I've downloaded and installed the branch from git. Now, using PySide,
the "out of scope" initial problem is solved (the histogram is correclty
shown -centered- on the plot window), but still no axes.
[image: hist1.png]
​
Do you have another idea?
Post by Diego Mancilla
Hello Luke,
Thank you for your answers. I will try what you suggest. I'll let you know.
d.
On Sat, Jul 7, 2018 at 2:35 AM Luke Campagnola <
Post by Luke Campagnola
This is just a guess, but I think this may be related to using scaling
/ high DPI in windows, and I think it may have been fixed already. Could
you try the latest code from the develop branch on github?
Post by dhabbyc
Hello,
I'm a little bit confused: i have a windows OS and both PySide
(1.2.4) and PyQt4 installed.
When I run the "histogram" example just as it is, pyqtgraph chooses
<https://lh3.googleusercontent.com/-AK-MZzfP-kw/Wz5qwhyUeuI/AAAAAAAAAdk/nDSCR4gOrwk3rd4fr8aLGMtl0idbnFxWACLcBGAs/s1600/hist1.png>
<https://lh3.googleusercontent.com/-JSonMheh9nc/Wz5rHjI0TzI/AAAAAAAAAds/CMCd-aI8pTozWVBlr1z3YVFM5KXOdpsRwCLcBGAs/s1600/hist2.png>
<https://lh3.googleusercontent.com/-xJ_lNiZRTZ0/Wz5reLMaqGI/AAAAAAAAAd0/bsZVp-IyZVYDBtoL9ZRTjQaCOTvzd1qhACLcBGAs/s1600/hist3.png>
Is this a bug or I'm doing something wrong.
*# -*- coding: utf-8 -*-*
*"""*
*In this example we draw two different kinds of histogram.*
*"""*
*#import initExample ## Add path to library (just for examples; you do
not need this)*
*#import PySide*
*import pyqtgraph as pg*
*from pyqtgraph.Qt import QtCore, QtGui, USE_PYSIDE, USE_PYQT4*
*import numpy as np*
*print pg.USE_PYSIDE, pg.USE_PYQT4*
*win = pg.GraphicsWindow()*
*win.resize(800,350)*
*win.setWindowTitle('pyqtgraph example: Histogram')*
*plt1 = win.addPlot()*
*#plt2 = win.addPlot()*
*## make interesting distribution of values*
*vals = np.hstack([np.random.normal(size=500),
np.random.normal(size=260, loc=4)])*
*## compute standard histogram*
*y,x = np.histogram(vals, bins=np.linspace(-3, 8, 40))*
*## Using stepMode=True causes the plot to draw two lines for each sample.*
*## notice that len(x) == len(y)+1*
*plt1.plot(x, y, stepMode=True, fillLevel=0, brush=(0,0,255,150))*
*## Now draw all points as a nicely-spaced scatter plot*
*#y = pg.pseudoScatter(vals, spacing=0.15)*
*#plt2.plot(vals, y, pen=None, symbol='o', symbolSize=5)*
*#plt2.plot(vals, y, pen=None, symbol='o', symbolSize=5,
symbolPen=(255,255,255,200), symbolBrush=(0,0,255,150))*
*## Start Qt event loop unless running in interactive mode or using pyside.*
*if __name__ == '__main__':*
* import sys*
* if (sys.flags.interactive != 1) or not hasattr(QtCore,
'PYQT_VERSION'):*
* QtGui.QApplication.instance().exec_()*
Could someone help me please?
--
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
To view this discussion on the web visit
https://groups.google.com/d/msgid/pyqtgraph/5c68ea89-11de-46ec-9cbd-41847d988cf8%40googlegroups.com
<https://groups.google.com/d/msgid/pyqtgraph/5c68ea89-11de-46ec-9cbd-41847d988cf8%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
To view this discussion on the web visit
https://groups.google.com/d/msgid/pyqtgraph/CACZXET8kaL2PfQMcigze3N4Lk9tLjBjvy7EBHiEa%2B7Xst4OMXQ%40mail.gmail.com
<https://groups.google.com/d/msgid/pyqtgraph/CACZXET8kaL2PfQMcigze3N4Lk9tLjBjvy7EBHiEa%2B7Xst4OMXQ%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
To view this discussion on the web visit
https://groups.google.com/d/msgid/pyqtgraph/CAKzfFOQc__hnv23fdD1tnoTOK0hHxEB--QchzwnbOEAh3F85Jg%40mail.gmail.com
<https://groups.google.com/d/msgid/pyqtgraph/CAKzfFOQc__hnv23fdD1tnoTOK0hHxEB--QchzwnbOEAh3F85Jg%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
To view this discussion on the web visit
https://groups.google.com/d/msgid/pyqtgraph/CACZXET-imUorswbkGhtLFp8Wqj7VbRq%3Dr_vW9ouKC4sb0wXNqw%40mail.gmail.com
<https://groups.google.com/d/msgid/pyqtgraph/CACZXET-imUorswbkGhtLFp8Wqj7VbRq%3Dr_vW9ouKC4sb0wXNqw%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 pyqtgraph+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/CAKzfFOTd7MoH-W4vKkcKU%3D4v0vCFZCiWSAxA-HW2HZiEOzD46Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Diego Mancilla
2018-08-24 19:11:31 UTC
Permalink
Hello Luke,

After some digging around in the pyqtgraph code I found that the "paint"
method of the AxisItem class never gets called using pyside (at least not
on my machine, which in deed has a high DPI monitor). Actually nothing
thats inherits from GraphicsWidget gets his paint method called ... ever. I
searched in the qt docs ways to force que painting of items but I came out
short. Updating the related items (update method) produces no effect.

By the way, the Axis items are present in the undelaying scene (and view)
or at least they show up at the output of 'items' method.

D.
Post by Diego Mancilla
Thank you Luke,
*sys.platform: win32*
*sys.version: 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:25:58) [MSC
v.1500 64 bit (AMD64)]*
*qt bindings: PySide 1.2.4 Qt 4.8.7*
*pyqtgraph: 0.11.0.dev0+ga240766; None*
*config:*
*{'antialias': False,*
* 'background': 'k',*
* 'crashWarning': False,*
* 'editorCommand': None,*
* 'enableExperimental': False,*
* 'exitCleanup': True,*
* 'foreground': 'd',*
* 'imageAxisOrder': 'col-major',*
* 'leftButtonPan': True,*
* 'useOpenGL': False,*
* 'useWeave': False,*
* 'weaveDebug': False}*
*None*
Regards.
On Wed, Jul 11, 2018 at 11:49 AM Luke Campagnola <
Post by Luke Campagnola
I don't have any other ideas at the moment. I will see if I can find a
windows machine + high DPI + PySide to test on.
Meanwhile, can you post the output of pg.systemInfo() ?
Post by Diego Mancilla
Hello Luke,
I've downloaded and installed the branch from git. Now, using PySide,
the "out of scope" initial problem is solved (the histogram is correclty
shown -centered- on the plot window), but still no axes.
[image: hist1.png]
​
Do you have another idea?
Post by Diego Mancilla
Hello Luke,
Thank you for your answers. I will try what you suggest. I'll let you know.
d.
On Sat, Jul 7, 2018 at 2:35 AM Luke Campagnola <
Post by Luke Campagnola
This is just a guess, but I think this may be related to using scaling
/ high DPI in windows, and I think it may have been fixed already. Could
you try the latest code from the develop branch on github?
Post by dhabbyc
Hello,
I'm a little bit confused: i have a windows OS and both PySide
(1.2.4) and PyQt4 installed.
When I run the "histogram" example just as it is, pyqtgraph chooses
<https://lh3.googleusercontent.com/-AK-MZzfP-kw/Wz5qwhyUeuI/AAAAAAAAAdk/nDSCR4gOrwk3rd4fr8aLGMtl0idbnFxWACLcBGAs/s1600/hist1.png>
<https://lh3.googleusercontent.com/-JSonMheh9nc/Wz5rHjI0TzI/AAAAAAAAAds/CMCd-aI8pTozWVBlr1z3YVFM5KXOdpsRwCLcBGAs/s1600/hist2.png>
<https://lh3.googleusercontent.com/-xJ_lNiZRTZ0/Wz5reLMaqGI/AAAAAAAAAd0/bsZVp-IyZVYDBtoL9ZRTjQaCOTvzd1qhACLcBGAs/s1600/hist3.png>
Is this a bug or I'm doing something wrong.
*# -*- coding: utf-8 -*-*
*"""*
*In this example we draw two different kinds of histogram.*
*"""*
*#import initExample ## Add path to library (just for examples; you
do not need this)*
*#import PySide*
*import pyqtgraph as pg*
*from pyqtgraph.Qt import QtCore, QtGui, USE_PYSIDE, USE_PYQT4*
*import numpy as np*
*print pg.USE_PYSIDE, pg.USE_PYQT4*
*win = pg.GraphicsWindow()*
*win.resize(800,350)*
*win.setWindowTitle('pyqtgraph example: Histogram')*
*plt1 = win.addPlot()*
*#plt2 = win.addPlot()*
*## make interesting distribution of values*
*vals = np.hstack([np.random.normal(size=500),
np.random.normal(size=260, loc=4)])*
*## compute standard histogram*
*y,x = np.histogram(vals, bins=np.linspace(-3, 8, 40))*
*## Using stepMode=True causes the plot to draw two lines for each sample.*
*## notice that len(x) == len(y)+1*
*plt1.plot(x, y, stepMode=True, fillLevel=0, brush=(0,0,255,150))*
*## Now draw all points as a nicely-spaced scatter plot*
*#y = pg.pseudoScatter(vals, spacing=0.15)*
*#plt2.plot(vals, y, pen=None, symbol='o', symbolSize=5)*
*#plt2.plot(vals, y, pen=None, symbol='o', symbolSize=5,
symbolPen=(255,255,255,200), symbolBrush=(0,0,255,150))*
*## Start Qt event loop unless running in interactive mode or using pyside.*
*if __name__ == '__main__':*
* import sys*
* if (sys.flags.interactive != 1) or not hasattr(QtCore,
'PYQT_VERSION'):*
* QtGui.QApplication.instance().exec_()*
Could someone help me please?
--
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,
To view this discussion on the web visit
https://groups.google.com/d/msgid/pyqtgraph/5c68ea89-11de-46ec-9cbd-41847d988cf8%40googlegroups.com
<https://groups.google.com/d/msgid/pyqtgraph/5c68ea89-11de-46ec-9cbd-41847d988cf8%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
To view this discussion on the web visit
https://groups.google.com/d/msgid/pyqtgraph/CACZXET8kaL2PfQMcigze3N4Lk9tLjBjvy7EBHiEa%2B7Xst4OMXQ%40mail.gmail.com
<https://groups.google.com/d/msgid/pyqtgraph/CACZXET8kaL2PfQMcigze3N4Lk9tLjBjvy7EBHiEa%2B7Xst4OMXQ%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
To view this discussion on the web visit
https://groups.google.com/d/msgid/pyqtgraph/CAKzfFOQc__hnv23fdD1tnoTOK0hHxEB--QchzwnbOEAh3F85Jg%40mail.gmail.com
<https://groups.google.com/d/msgid/pyqtgraph/CAKzfFOQc__hnv23fdD1tnoTOK0hHxEB--QchzwnbOEAh3F85Jg%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
To view this discussion on the web visit
https://groups.google.com/d/msgid/pyqtgraph/CACZXET-imUorswbkGhtLFp8Wqj7VbRq%3Dr_vW9ouKC4sb0wXNqw%40mail.gmail.com
<https://groups.google.com/d/msgid/pyqtgraph/CACZXET-imUorswbkGhtLFp8Wqj7VbRq%3Dr_vW9ouKC4sb0wXNqw%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 pyqtgraph+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/CAKzfFOQvgxx1gVFt3-C0Ufrd7N_nXuTVpRffkoC%2BhkDMniG4aw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Loading...