此问题已在此处有答案:
Scatter plot with different text at each data point(9个回答)
How to annotate points in a scatterplot based on a pandas column(1个答案)
Annotating scatterplot points with DF column text Matplotlib(1个答案)
How to add hovering annotations to a plot(12个答案)
Annotate data points while plotting from Pandas DataFrame(4个答案)
6小时前关闭
我正在创建一个英国县犯罪率与人口的散点图,我希望每个点都标有县的名称,这样我就可以可视化它并查看每个县的相对安全性(使用numpy,panda和matplotlib)
我还没有尝试任何东西,但我知道你可以使用annotate()函数来获得数字
1条答案
按热度按时间polkgigr1#
你可以使用matplotlib中的
annotate()
函数。我在这个csv文件中使用了一些数据:
得到这个输出
result