使用Spyder IDE绘制散点图

问题描述 投票:0回答:1

我正在学习此数据科学课程,他们对材料的解释不佳。有人可以向我解释以下内容吗?

在此行:

plt.annotate(label, xy= (friend_count, minute_count), xytext = (-5,5), textcoords = 'offset points')

xytext参数的目的是什么?为什么是(5,-5),数字代表什么?什么是'offset points'及其用途?

谢谢!

python
1个回答
0
投票

您必须查看matplotlib.pyplot.annotate的文档:

matplotlib.pyplot.annotate:是放置文本的位置xytext。如果为(x,y),则默认为xy。

[None:给出textcoords的坐标系。xytext设置与xy值的偏移量(以磅为单位)。

© www.soinside.com 2019 - 2024. All rights reserved.