在下面的使用matplotlib.triplot的示例中,我如何指定边缘颜色具有颜色,比如0xFFAC67?
import matplotlib.pyplot as plt
import matplotlib.tri as tri
import numpy as np
xy = np.asarray([ [0.2, 0.1], [0.9, -0.1], [1.2, 1.29] ])
x = np.degrees(xy[:, 0])
y = np.degrees(xy[:, 1])
triangles = np.asarray([ [0, 1, 2] ])
mesh = tri.Triangulation( x, y, triangles )
plt.figure()
plt.gca().set_aspect('equal')
plt.triplot( mesh, 'g-', lw=1.0 )
plt.show()发布于 2019-06-16 21:37:40
您可以使用参数c指定颜色。您指定的颜色无效,但用#替换0x的工作方式如下
plt.gca().set_aspect('equal')
plt.triplot(mesh, '-', lw=1.0, c='#FFAC67')
plt.show()

https://stackoverflow.com/questions/56619252
复制相似问题