![]() When it is, we change the text, position, and visibility of the annotation accordingly. We’ll create a blank annotation and check if the mouse position is over one of the plotted points. ![]() Great! We know how to add and modify elements in our plot and detect the movement of the cursor. The event we receive from mpl_connect at our hover function has some valuable properties let’s try to get the XY coordinates of the mouse. So even if some element is only displayed when a specific event is triggered, we still should define it outside of our function. The idea is to draw the chart with all the elements we’ll use and then use the events to modify those elements.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |