2024-04-25 07:36:44 发布
网友
使用matplotlib和常规打印功能,我可以使标记的边彼此穿过,而不是像图中所示那样堆叠吗
没有内置选项将标记的面颜色与边缘分开。因此,为了使标记边清晰可见,可以绘制两个图,一个用于面,另一个用于边
import numpy as np; np.random.seed(32) import matplotlib.pyplot as plt x = np.arange(30) y = np.cumsum(np.random.randn(30)) fig, (ax, ax2) = plt.subplots(1,2, figsize=(5.5,2)) ## plot ax.plot(x,y, marker="s", ms=15, color="C3") ax.plot(x,y, marker="s", ms=15, color="none", mec="black") ## scatter ax2.scatter(x,y, marker="s", s=15**2, facecolor="C3") ax2.scatter(x,y, marker="s", s=15**2, facecolor="none", edgecolor="black") ax.set_title("plot") ax2.set_title("scatter") fig.tight_layout() plt.show()
没有内置选项将标记的面颜色与边缘分开。因此,为了使标记边清晰可见,可以绘制两个图,一个用于面,另一个用于边
相关问题 更多 >
编程相关推荐