When I pass a non-uniform level to a contour plot, the color bar acts as expected, but the actual contour plot is colored incorrectly. Is there a way around this?
As an example, using uniform levels l1
:
using Plots
x = y = collect(0:0.001:1)
f(x,y) = exp(x+1)*exp(y+1)*(x-y^3)
l1 = -20:2.5:30
contourf(x, y, f, c=:turbo, levels=l1)
we get:
But then changing to non-uniform levels l2
:
l2 = [-20:1:0..., 5:5:30...]
contourf(x, y, f, c=:turbo, levels=l2)
we get:
Is this a bug or is this intentional behaviour I misunderstood? Is there a way to get around this?