我想给matplotlib自动生成的marker
点添加标签,但是我不知道如何从Pandas DataFrameGroupby对象中找到这些点(下面加粗的i
和{
for x, group in graph:
t = group.plot(x="CompressorSpeed", y="ratio", marker='o').set_title(x)
plt.annotate('This is awesome', xy=( **i**, **j** ), arrowprops=dict(arrowstyle="->"))
plt.savefig(pp, format="pdf")
图在其中(并且csvdata
是从read_csv(...)
创建的Pandas DataFrame对象)
如果我硬编码一个已知点,我可以验证是否创建了xy
标签。在
以下是带有标记点的附加图像:
很难确定,因为您没有提供数据帧的内容。以后,请考虑生成Minimal, Complete, and Verifiable example
话虽如此,我想这就是你想要的:
实现相同目标的另一种方法是:
^{pr2}$相关问题 更多 >
编程相关推荐