I'm looking for a method to change the levels of a matplotlib contour/contourf plot after it has been plotted, in a way that is similar to the Axes.set_xlim()
or Axes.set_xticks()
methods for example. Does anything like this exist?
Thanks
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