1

We want to save the points that we have clicked on a list with the coordinates or in a database.

2 Answers 2

0

Matplotlib does have buttons, see the example code here, however you might want to look at using something like PyQT5 to create a UI for this purpose. You can setup a GUI quickly with QTDesigner, then use promote a widget to a matplotlib graph (see this tutorial) and link matplotlib's "on click" event handler to whatever purpose you would like to achieve.

Sign up to request clarification or add additional context in comments.

3 Comments

Let me see if i have understood what you have explain to me. I have to create a GUI with pyqt but i can´t add a graph of the qt designer. Instead of that i have to transform a widget into a matplotlib graph. Then, can i connect some buttons with the matplotlib graph ?
Thats correct, see this post stackoverflow.com/questions/43947318/… to see how to work with matplotlib graphs with PyQt5. It will take a bit of playing around to understand how PyQt5 works, but have a play around and try and figure it out, its the best way to learn imo.
Okey ! I will investigate on that and then try to make it possible. Possibly i will post more questions about that because i have never used python before and that is my first time.
0

This is definitely possible with matplotlib, however without a minimum working example it's difficult to give you a full answer. For this kind of project, I've worked with Jupyter notebooks as they allow you to define pressable buttons through widgets (for example here).

I'd start by having a look at matplotlib event handling, and for example this answer for how to record an onclick event.

1 Comment

Wow i didn´t know that. But the problem is that i have to creat the GUI application with pycharm. I saw that qt have a lot of widgets and options to create an interface and that is i choose that package, but now i don´t know what i should do.....

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.