1

I have a field define on a cloud of points and I want to plot this field. I am using pyplot tricontourf to produce this plot:

tricontourf(pos[:,0], pos[:,1], u1[:,row], levels=levels, vmin=vmin, vmax=vmax, cmap=cmap)

introducir la descripción de la imagen aquí

The problem here is that the plot shows values in an area where there are no points and I expect an empty field there instead. The problematic area is the upper red semi-circle.

I don't know the parameterization of my domain, so I cannot use a mask to do u1[mask] = np.nan.

Thanks

  • 1
    Please, please don't ask the [same question](https://stackoverflow.com/questions/63794514/pyplot-tricontourf-undesired-interpolation) again. Especially not when you aren't adding a reproducible example.Note that the `pos[]` values don't need to be ordered. Couldn't you make a copy of `pos[]` and of `u1[:,row]` and add some `pos[]` coordinates inside the semicircle together with some `np.nan` values appended to the copy of `u1[:,row]`? – JohanC Sep 08 '20 at 15:25
  • tricontourf does not accept np.nan values – Mario Lino Valencia Sep 08 '20 at 15:43
  • [matplotlib contour/contourf of concave non-gridded data](https://stackoverflow.com/questions/42426095/matplotlib-contour-contourf-of-concave-non-gridded-data) contains a few tactics – JohanC Sep 08 '20 at 15:53

0 Answers0