0

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 
Alan
  • 9
  • 1

1 Answers1

0

This doesn't seem possible. There is a set_array method that might seem like it would work, but testing it just now doesn't change the levels plotted. You can always call contourf again.

busybear
  • 10,194
  • 1
  • 25
  • 42