PyQtGraph How to zoom in using a button
up vote
1
down vote
favorite
I'm using PyQTGraph along with PyQT5, and I've added a GraphicsLayoutWidget, with mouse events to add markers.
canvas_ruler = pg.GraphicsLayoutWidget()
formLayout.addWidget(self.canvas_ruler)
plot_ruler = canvas_ruler.addPlot(name="Ruler")
plot_ruler.hideAxis('left')
canvas_ruler.scene().sigMouseMoved.connect(self.mouseMoved)
canvas_ruler.scene().sigMouseClicked.connect(self.mouseClicked)
plot_ruler.setMouseEnabled(x=True, y=False)
What I would like to add, are 2 buttons, to zoom in and zoom out, currently the mouse wheel event, does zooming in/out. But I want to disable that and add 2 buttons for it. I probably should:
setMouseEnabled(x=False, y=False)
But I don't know how to trigger the zoom using code, I couldn't find it's APIs, like sigMouseMoved.connect.
python-3.x pyqtgraph
add a comment |
up vote
1
down vote
favorite
I'm using PyQTGraph along with PyQT5, and I've added a GraphicsLayoutWidget, with mouse events to add markers.
canvas_ruler = pg.GraphicsLayoutWidget()
formLayout.addWidget(self.canvas_ruler)
plot_ruler = canvas_ruler.addPlot(name="Ruler")
plot_ruler.hideAxis('left')
canvas_ruler.scene().sigMouseMoved.connect(self.mouseMoved)
canvas_ruler.scene().sigMouseClicked.connect(self.mouseClicked)
plot_ruler.setMouseEnabled(x=True, y=False)
What I would like to add, are 2 buttons, to zoom in and zoom out, currently the mouse wheel event, does zooming in/out. But I want to disable that and add 2 buttons for it. I probably should:
setMouseEnabled(x=False, y=False)
But I don't know how to trigger the zoom using code, I couldn't find it's APIs, like sigMouseMoved.connect.
python-3.x pyqtgraph
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I'm using PyQTGraph along with PyQT5, and I've added a GraphicsLayoutWidget, with mouse events to add markers.
canvas_ruler = pg.GraphicsLayoutWidget()
formLayout.addWidget(self.canvas_ruler)
plot_ruler = canvas_ruler.addPlot(name="Ruler")
plot_ruler.hideAxis('left')
canvas_ruler.scene().sigMouseMoved.connect(self.mouseMoved)
canvas_ruler.scene().sigMouseClicked.connect(self.mouseClicked)
plot_ruler.setMouseEnabled(x=True, y=False)
What I would like to add, are 2 buttons, to zoom in and zoom out, currently the mouse wheel event, does zooming in/out. But I want to disable that and add 2 buttons for it. I probably should:
setMouseEnabled(x=False, y=False)
But I don't know how to trigger the zoom using code, I couldn't find it's APIs, like sigMouseMoved.connect.
python-3.x pyqtgraph
I'm using PyQTGraph along with PyQT5, and I've added a GraphicsLayoutWidget, with mouse events to add markers.
canvas_ruler = pg.GraphicsLayoutWidget()
formLayout.addWidget(self.canvas_ruler)
plot_ruler = canvas_ruler.addPlot(name="Ruler")
plot_ruler.hideAxis('left')
canvas_ruler.scene().sigMouseMoved.connect(self.mouseMoved)
canvas_ruler.scene().sigMouseClicked.connect(self.mouseClicked)
plot_ruler.setMouseEnabled(x=True, y=False)
What I would like to add, are 2 buttons, to zoom in and zoom out, currently the mouse wheel event, does zooming in/out. But I want to disable that and add 2 buttons for it. I probably should:
setMouseEnabled(x=False, y=False)
But I don't know how to trigger the zoom using code, I couldn't find it's APIs, like sigMouseMoved.connect.
python-3.x pyqtgraph
python-3.x pyqtgraph
asked Nov 8 at 14:17
Amin
315318
315318
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53209597%2fpyqtgraph-how-to-zoom-in-using-a-button%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password