简体   繁体   English

使用 Spyder IDE 绘制散点图

[英]Plotting a scatter plot with Spyder IDE

I'm following this Data Science Course and they don't explain the material well.我正在关注这个数据科学课程,他们没有很好地解释材料。 Could someone please explain the following to me?有人可以向我解释以下内容吗?

In this Line:在这一行:

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

What is the purpose of xytext argument? xytext参数的目的是xytext Why is it (5,-5) , what do the numbers represent?为什么是(5,-5) ,数字代表什么? What is 'offset points' and its purpose?什么是'offset points'及其目的?

Thank you!谢谢!

You have to check out the documentation of matplotlib.pyplot.annotate :您必须查看matplotlib.pyplot.annotate的文档:

xytext : is the position (x,y) to place the text at. xytext : 是放置文本的位置(x,y) If None , defaults to xy.如果None ,默认为 xy。

textcoords : The coordinate system that xytext is given in. 'offset points' set the offset from the xy value in points. textcoords : textcoords的坐标系xytext 'offset points''offset points'设置 xy 值的偏移量。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM