黑色是 matplotlib 标记能够旋转的 https://stackoverflow.com/questions/49660174/rotate-existing-matplotlib-markers/49662571#49662571。蓝色/橙色的是填充样式标记 https://matplotlib.org/gallery/lines_bars_and_markers/marker_fillstyle_reference.html,而且我还没有设法以同样的方式旋转它们。
这是生成图形的代码。在这个版本中t
未使用。
import matplotlib as mpl
import matplotlib.pyplot as plt
x = [0,10,20,30,40,50,60,70,80,90]
for i in x:
t = mpl.markers.MarkerStyle(marker='o')
t._transform = t.get_transform().rotate_deg(-i)
marker_style = dict(color='b', markerfacecoloralt='orange', markeredgecolor='w', markersize=25,
marker='o' )
plt.plot(i, i, marker=(2, 0, -i), c='k',markersize=30, linestyle='None')
plt.plot(i, i, marker=(3, 0, -i), c='k',markersize=10, linestyle='None')
plt.plot(i, i+20,fillstyle='top', **marker_style)
plt.margins(0.15); plt.grid();plt.show()
我尝试过但没有成功:
marker_style = dict(....., marker=(3, 3, -i) )
or
marker_style = dict(....., marker=t )
or
plt.plot(i, i+20,fillstyle='top', marker=(3, 3, -i)
如果您知道并告诉如何将这些东西组合在一起,谢谢!解决方案与plt.scatter()
也可以。