Discussion:
[pyqtgraph] Hanging xaxis whe trying to supply custom AxisItem to PlotWidget in PyQt4
Kenneth Nielsen
2016-06-16 08:11:04 UTC
Permalink
<Loading Image...>
Hallo pyqtgraph developers and thanks for an awesome package

I want to embed a pyqtgraph Qt Widget into my own Qt program and I want to
use a custom xaxis (with time formatting, but that is besides the point).
When I try to do it by supplying the axisItem argument to PlotWidget I do
get the new axis in place, but I also still have the old x-axis hanging at
the top left of the widget. The following is the smallest code example that
I can use to reproduce the proble

import sys

import numpy as np
from pyqtgraph import PlotWidget, AxisItem
from PyQt4 import QtGui, QtCore


class TimeAxisItem(AxisItem):
"""Only included to show that the point is to subclass"""


class Example(QtGui.QWidget):
def __init__(self):
super(Example, self).__init__()
self.setGeometry(300, 300, 1000, 1000)
self.plot = PlotWidget(self, axisItems={'bottom': TimeAxisItem(
orientation='bottom')})
self.plot.resize(900, 900)
self.curve = self.plot.plot(np.linspace(0, 10, 100), np.random.
random(100))
self.show()


if __name__ == '__main__':
app = QtGui.QApplication(sys.argv)
ex = Example()
sys.exit(app.exec_())

Which produces the Window shown in the attached image.

Am I doing it wrong? I should say, that I can produce the correct result
(dateformatting of xaxis without the hanging axis) by simply getting the
existing xaxis and monkey patching tickStrings, but I would rather not have
to do that.

Regards Kenneth
--
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/bac5582d-6d99-4917-97a2-ed6e4e5c460d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Kenneth Nielsen
2016-07-14 06:06:19 UTC
Permalink
No one has any input on this?
Post by Kenneth Nielsen
<https://lh3.googleusercontent.com/-7rdkH4BvGsk/V2JeN7HZwRI/AAAAAAAADio/tS93_uitz5Y31MXerldIcx1VYD29qZ8cQCLcB/s1600/doublex.png>
Hallo pyqtgraph developers and thanks for an awesome package
I want to embed a pyqtgraph Qt Widget into my own Qt program and I want to
use a custom xaxis (with time formatting, but that is besides the point).
When I try to do it by supplying the axisItem argument to PlotWidget I do
get the new axis in place, but I also still have the old x-axis hanging at
the top left of the widget. The following is the smallest code example that
I can use to reproduce the proble
import sys
import numpy as np
from pyqtgraph import PlotWidget, AxisItem
from PyQt4 import QtGui, QtCore
"""Only included to show that the point is to subclass"""
super(Example, self).__init__()
self.setGeometry(300, 300, 1000, 1000)
self.plot = PlotWidget(self, axisItems={'bottom': TimeAxisItem(
orientation='bottom')})
self.plot.resize(900, 900)
self.curve = self.plot.plot(np.linspace(0, 10, 100), np.random.
random(100))
self.show()
app = QtGui.QApplication(sys.argv)
ex = Example()
sys.exit(app.exec_())
Which produces the Window shown in the attached image.
Am I doing it wrong? I should say, that I can produce the correct result
(dateformatting of xaxis without the hanging axis) by simply getting the
existing xaxis and monkey patching tickStrings, but I would rather not have
to do that.
Regards Kenneth
--
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/9103f480-1265-423f-9568-f480e7e9c6cd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
v***@gmail.com
2016-07-14 08:06:29 UTC
Permalink
Search the group before asking, this is "I-don't-know-what" time that I
suggesting updating pyqtgraph:
http://stackoverflow.com/questions/33717000/pyqtgraph-custom-tick-labels-potential-bug
Post by Kenneth Nielsen
No one has any input on this?
Post by Kenneth Nielsen
<https://lh3.googleusercontent.com/-7rdkH4BvGsk/V2JeN7HZwRI/AAAAAAAADio/tS93_uitz5Y31MXerldIcx1VYD29qZ8cQCLcB/s1600/doublex.png>
Hallo pyqtgraph developers and thanks for an awesome package
I want to embed a pyqtgraph Qt Widget into my own Qt program and I want
to use a custom xaxis (with time formatting, but that is besides the
point). When I try to do it by supplying the axisItem argument to
PlotWidget I do get the new axis in place, but I also still have the old
x-axis hanging at the top left of the widget. The following is the smallest
code example that I can use to reproduce the proble
import sys
import numpy as np
from pyqtgraph import PlotWidget, AxisItem
from PyQt4 import QtGui, QtCore
"""Only included to show that the point is to subclass"""
super(Example, self).__init__()
self.setGeometry(300, 300, 1000, 1000)
self.plot = PlotWidget(self, axisItems={'bottom': TimeAxisItem(
orientation='bottom')})
self.plot.resize(900, 900)
self.curve = self.plot.plot(np.linspace(0, 10, 100), np.random.
random(100))
self.show()
app = QtGui.QApplication(sys.argv)
ex = Example()
sys.exit(app.exec_())
Which produces the Window shown in the attached image.
Am I doing it wrong? I should say, that I can produce the correct result
(dateformatting of xaxis without the hanging axis) by simply getting the
existing xaxis and monkey patching tickStrings, but I would rather not have
to do that.
Regards Kenneth
--
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/9103f480-1265-423f-9568-f480e7e9c6cd%40googlegroups.com
<https://groups.google.com/d/msgid/pyqtgraph/9103f480-1265-423f-9568-f480e7e9c6cd%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/CAD_qyJpZ7Mcgehi5CfCTsZLJkQE7PvuGy1LeOCsyGZDkKYG9OA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Kenneth Nielsen
2016-07-14 14:16:42 UTC
Permalink
Sorry about that.

I *did* search for it (which I always do before reporting bugs), but did
not find that stackoverflow thread.

Thanks for the reply.
Post by v***@gmail.com
Search the group before asking, this is "I-don't-know-what" time that I
http://stackoverflow.com/questions/33717000/pyqtgraph-custom-tick-labels-potential-bug
Post by Kenneth Nielsen
No one has any input on this?
Post by Kenneth Nielsen
<https://lh3.googleusercontent.com/-7rdkH4BvGsk/V2JeN7HZwRI/AAAAAAAADio/tS93_uitz5Y31MXerldIcx1VYD29qZ8cQCLcB/s1600/doublex.png>
Hallo pyqtgraph developers and thanks for an awesome package
I want to embed a pyqtgraph Qt Widget into my own Qt program and I want
to use a custom xaxis (with time formatting, but that is besides the
point). When I try to do it by supplying the axisItem argument to
PlotWidget I do get the new axis in place, but I also still have the old
x-axis hanging at the top left of the widget. The following is the smallest
code example that I can use to reproduce the proble
import sys
import numpy as np
from pyqtgraph import PlotWidget, AxisItem
from PyQt4 import QtGui, QtCore
"""Only included to show that the point is to subclass"""
super(Example, self).__init__()
self.setGeometry(300, 300, 1000, 1000)
self.plot = PlotWidget(self, axisItems={'bottom': TimeAxisItem(
orientation='bottom')})
self.plot.resize(900, 900)
self.curve = self.plot.plot(np.linspace(0, 10, 100), np.random.
random(100))
self.show()
app = QtGui.QApplication(sys.argv)
ex = Example()
sys.exit(app.exec_())
Which produces the Window shown in the attached image.
Am I doing it wrong? I should say, that I can produce the correct result
(dateformatting of xaxis without the hanging axis) by simply getting the
existing xaxis and monkey patching tickStrings, but I would rather not have
to do that.
Regards Kenneth
--
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/9103f480-1265-423f-9568-f480e7e9c6cd%40googlegroups.com
<https://groups.google.com/d/msgid/pyqtgraph/9103f480-1265-423f-9568-f480e7e9c6cd%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/36f46a85-51ae-4a24-a9fd-48e0c2e2ab03%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...