|
From: Ian T. <ian...@gm...> - 2012-11-15 08:51:26
|
On 14 November 2012 21:05, Bror Jonsson <bro...@gm...> wrote: > Dear all, > > I'm trying to to show where one set of values have NaN's on the contour > plot of another set of values. I do this by creating a mask as such: > > fld = randn(4,4) > fld[:2,:2] = np.nan > mask[mask==0] = np.nan > contourf(arange(4),arange(4),fld) > contourf(arange(4),arange(4),mask) > > The problem is that the mask patch doesn't cover the empty space in the > fld contour. Is there any way to make this happen? > > My ultimate goal is something like this: > > fld2 = randn(4,4) > contourf(arange(4),arange(4),fld2) > contourf(arange(4),arange(4),mask,[1,1], extend='both', > colors='w', alpha=0.5) > > to present where fld has NaN's on the fld2 plot. > > > Many thanks in advance! > > Bror Jonsson > Hello Bror, It is not clear from your code snippets exactly what you are asking for. Please can you post a full runnable example? Ian Thomas |