I have some data defined on regular Cartesian grids. I would like to show only some of them with a condition based on the radius from the center. This will effectively create an annular structure with a hole in the center. As a result, I cannot use imshow. tricontourfor tripcolor- this is what I found for this. My code looks something like this:
R = np.sqrt(x**2+y**2)
flag = (R<150)*(R>10)
plt.tricontourf(x[flag], y[flag], data[flag], 100)
where xand yare the grids of the grid, where it datadetermines. The problem here is that, as tricontourfwell as tripcolortrying to fill in the middle of the ring, where, I hope, can be left blank.
To be more specific, the one on the left is similar to what I want, but I can only get the one on the right with this code snippet shown above.

source
share