【发布时间】:2020-12-11 00:02:56
【问题描述】:
我正在寻找一种在绘制 matplotlib 等高线/等高线图后更改其级别的方法,其方式类似于 Axes.set_xlim() 或 Axes.set_xticks() 方法。这样的事情存在吗?
谢谢
fig = Figure()
ax = fig.add_subplot(111)
# Create plot with automatic levels
ax.contourf(x, y, z)
# Change levels
levels = [0,1,2,3,4,5]
ax.set_levels(levels) # <------ Type of method I am looking for
【问题讨论】:
-
不存在。
-
这样做没有任何好处,反正轮廓需要重新计算,所以你干脆删除轮廓再调用contourf就好了。
标签: python matplotlib contour contourf