"Yuyuan" <guyuyuan@hotmail.com> wrote in message <hj2grc$go$1@fred.mathworks.com>...
> "Rob Campbell" <matlab@robertREMOVEcampbell.removethis.co.uk> wrote in message <hj2cm7$65t$1@fred.mathworks.com>...
> > "Yuyuan" <guyuyuan@hotmail.com> wrote in message <hj24va$psl$1@fred.mathworks.com>...
> > > I have
> > > x=[1, 2, 3, 4, 2, 3, 3, 3, 2, 1];
> > > y=[1, 0, 0, 1, 1.5, 1.5, 2, 3, 3, 2];
> > > v=1:10;
> > > h=patch(x,y,v);
> > > How to add an contour plot onto h?
> >
> > Normally one can do things like that by changing the 'cdata' property of the object (h, in your case). However, I'm not sure that patch objects work like that because in this case 'cdata' is a vector of values defining the color at each point along the edge.
> >
> > Are you just trying to make a mask for a contour plot? In this case, would something like this work for you?
> >
> > clf
> > contour(peaks,100)
> > axes('position',get(gca,'position'))
> > h=patch(x,y,v);
> > set(gca,'color','none')
> > set(h,'facecolor','w','edgecolor','w')
> > axis off
> Thanks for reply Rob!
>
> Actually, what I am really interested is trying to interpolate the sparsely distributed data inside an unit circle. I used TriScatteredInterp to construct an interpolant for the unit circle but it gave me NaNs outside the convahull by using 'linear' method, which generated a cracked cake. 'nearest' method won't give me NaNs but the interpolated surface looked so unnatural and unacceptable. So I am trying to directly patch (visualize) the data but it does not allow me to add contour onto the patched object. I am not sure if patch object is an assembly of many small triangle objects while contour is only good for surfaced (or metrics) objects?
> Yuyuan
Hello,
I have exactly the same problem:
I have some values for discrete vertices on a 3D patch object. Is it possible to interpolate the values for all the other vertices along the patch object?
Like Yuyuan said TriScatteredInterp returns NaNs for vertices outside the convex hull. Moreover it doesn't use the geometry information of the patch.
Maybe anyone knows a workaround by now?
Cheers
ArtS
