参见英文答案 >
Display numbers instead of points using pyplot 1个
> matplotlib scatter plot with different text at each data point 4个
编辑:这个问题不重复,我不想绘制数字而不是点数,我想在我的点旁边绘制数字.
> matplotlib scatter plot with different text at each data point 4个
编辑:这个问题不重复,我不想绘制数字而不是点数,我想在我的点旁边绘制数字.
我正在使用matplotlib创建一个情节.绘制[[3,9],[4,8],[5,4]]有三点
我可以轻松地用它们制作散点图
import matplotlib.pyplot as plt allPoints = [[3,4]] f,diagram = plt.subplots(1) for i in range(3): xPoint = allPoints[i][0] yPoint = allPoints[i][1] diagram.plot(xPoint,yPoint,'bo')
这产生了这个情节:
我想用数字1,2,3标记每个点.
import matplotlib.pyplot as plt allPoints = [[1,3,[2,4,[3,5,diagram = plt.subplots(1) for i in range(3): pointRefNumber = allPoints[i][0] xPoint = allPoints[i][1] yPoint = allPoints[i][2] diagram.annotate(pointRefNumber,(xPoint,yPoint))
解决方法
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。