import pyqtgraph as pgfrom pyqtgraph.Qt import QtCore, QtGui
pg.mkQApp()
pw = pg.PlotWidget()pw.show()p1 = pw.plotItem
# Second Viewbox and axisp2 = pg.ViewBox()ax2 = pg.AxisItem('right')ax2.setLabel('Axis 2')p1.layout.addItem(ax2, 2, 4)p1.scene().addItem(p2)
# Plot some datap1.plot([1, 2, 4, 8, 16, 32])p2.addItem(pg.PlotCurveItem([3200, 1600, 800, 400, 200, 100], pen='r'))
# Try to remove them againp1.layout.removeItem(ax2)p1.scene().removeItem(p2)
if __name__ == '__main__': import sys if (sys.flags.interactive != 1) or not hasattr(QtCore, 'PYQT_VERSION'): QtGui.QApplication.instance().exec_()
On 28 Dec 2014, at 00:15, Peter Maunz <peter...@gmail.com> wrote:
Sorry for not reading your post carefully. The suggested won't help.
--
You received this message because you are subscribed to a topic in the Google Groups "pyqtgraph" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pyqtgraph/3ZrIeqIqve4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pyqtgraph+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/5ba8b265-58c6-40c0-8983-338dde91baec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Any idea on how I can delete this axis completely?
Or, alternatively, is there a way to 'reset' the PlotWidget itself and re-add all the axes? I cannot simply delete and recreate it because in the actual application it is part of a Qt UI created in QT Designer.
--
You received this message because you are subscribed to a topic in the Google Groups "pyqtgraph" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pyqtgraph/3ZrIeqIqve4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pyqtgraph+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/CACZXET8s%2B795guc6a8E35e1oaB%2B8KH9VobwDjGtjjFbwzn7%2BCw%40mail.gmail.com.