Skip to content
Advertisement

How do I change color of the selected points in matplotlib?

I have written this code which allows the user to select 4 points on the graph and as the 4 points are selected, two lines are drawn. But I want the user to be able to see which points she has selected by changing the color of the point or drawing a small circle around it. I tried reading the matplotlib documentation but couldn’t understand what to add/change in my code.

I just want to change the color of the selected points or draw a small circle around the selected points. How do I do that?

JavaScript

Advertisement

Answer

The answer to your question is illustrated in your example itself. All you have to do is to grab the axes currently in context and plot your point emitted from the event on it. Here is a simple example that is not very dissimilar from your own.

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement