In matplotlib, I am looking to create an insert color bar to show the scale of my contour plot, but when I create a contour using a path, white bars run through the color bar, while when I use the path the color bar has the correct โsmoothโ look :

How can I get this nice smooth color panel from the filled outline on my regular outline graph? I would also be fine with a filled path, where, as I think, the zero level can be set to white.
Here is the code to generate this example:
from numpy import linspace, outer, exp from matplotlib.pyplot import figure, gca, clf, subplots_adjust, subplot from matplotlib.pyplot import contour, contourf, colorbar, xlim, ylim, title from mpl_toolkits.axes_grid1.inset_locator import inset_axes
Change Now I understand that at lower resolutions the behavior of white stripes is difficult to distinguish from some transparency of light. Here is an example with only 30 contour lines, which makes the problem more obvious:

Change 2 . Although Iโm still interested in figuring out how to do this in the general general case (for example, if there are negative values), in my particular case I decided that I could effectively create something similar to what I want by simply setting the levels of the filled path to start at level zero:
ca = contourf(x, y, z, levels=linspace(0.05, 1, 125))
Which basically looks like what I want:
