-
Notifications
You must be signed in to change notification settings - Fork 0
绘图指南
Starslayerx edited this page May 29, 2021
·
3 revisions
该指南简略记录各种常用的绘图技巧,用于填补matplotlib文章的不足
-
设置坐标轴范围
plt.xlim((left, right))
-
取消坐标轴和线(ticks & spines)
Axes.set_axis_off
-
将刻度旋转90度防止刻度重叠
plt.xticks(rotation=270) ``
-
替换刻度
- 图例
- 使用渐变的颜色绘图 colormaps
cmap = plt.cm.winter # s为步长,每一步一种颜色 for i in range(0,n,s): ax.plot(x, y, z, color=cmap(i/n), alpha=0.4)