Possible to make labels appear when hovering over a point in matplotlib?

后端 未结 9 1050
清酒与你
清酒与你 2020-11-22 00:52

I am using matplotlib to make scatter plots. Each point on the scatter plot is associated with a named object. I would like to be able to see the name of an object when I ho

9条回答
  •  无人及你
    2020-11-22 01:28

    If you use jupyter notebook, my solution is as simple as:

    %pylab
    import matplotlib.pyplot as plt
    import mplcursors
    plt.plot(...)
    mplcursors.cursor(hover=True)
    plt.show()
    

    YOu can get something like

提交回复
热议问题