From: Adam Chapman on
I've gone into the clabel function and put the following code
immediately below the main function code, in an attempt to stop labels
displaying if they correspond to a value > 4000 on the x-axis:

rect=get(h,'Extent');
for i=1:size(rect,1)
xywh=rect{i};
if xywh(1)>4000
set(h(i),'HandleVisibility','off')
end
end

However, this hasn't worked.

I've checked that the handle visibility property has been switched
from 'on' to 'off' on some label handles, but they are all still being
displayed on my figure.

Can anyone expalin this?
From: us on
Adam Chapman <adamchapman1985(a)hotmail.co.uk> wrote in message <2a284dba-ef2b-44c2-93e3-4aa70bc88899(a)t10g2000yqg.googlegroups.com>...
> I've gone into the clabel function and put the following code
> immediately below the main function code, in an attempt to stop labels
> displaying if they correspond to a value > 4000 on the x-axis:
>
> rect=get(h,'Extent');
> for i=1:size(rect,1)
> xywh=rect{i};
> if xywh(1)>4000
> set(h(i),'HandleVisibility','off')
> end
> end
>
> However, this hasn't worked.
>
> I've checked that the handle visibility property has been switched
> from 'on' to 'off' on some label handles, but they are all still being
> displayed on my figure.
>
> Can anyone expalin this?

can you show CSSM a small data set that reproduces this behavior(?)...

us
From: Adam Chapman on
On Jul 26, 12:42 pm, "us " <u...(a)neurol.unizh.ch> wrote:
> Adam Chapman <adamchapman1...(a)hotmail.co.uk> wrote in message <2a284dba-ef2b-44c2-93e3-4aa70bc88...(a)t10g2000yqg.googlegroups.com>...
> > I've gone into the clabel function and put the following code
> > immediately below the main function code, in an attempt to stop labels
> > displaying if they correspond to a value > 4000 on the x-axis:
>
> > rect=get(h,'Extent');
> > for i=1:size(rect,1)
> >     xywh=rect{i};
> >     if xywh(1)>4000
> >         set(h(i),'HandleVisibility','off')
> >     end
> > end
>
> > However, this hasn't worked.
>
> > I've checked that the handle visibility property has been switched
> > from 'on' to 'off' on some label handles, but they are all still being
> > displayed on my figure.
>
> > Can anyone expalin this?
>
> can you show CSSM a small data set that reproduces this behavior(?)...
>
> us- Hide quoted text -
>
> - Show quoted text -


an example:

[x,y] = meshgrid(-2:.2:2);
z = x.^exp(-x.^2-y.^2);
[C,h]=contourf(x,y,z);
clabel2(C,h)


were clabel2 is my modified clabel function, and the inequality from
the fisrt post is changed to:
if xywh(1)>0


It doesn't stop contour labels apperring in the region x>0, but I
can't see why
From: us on
Adam Chapman
> an example:
>
> [x,y] = meshgrid(-2:.2:2);
> z = x.^exp(-x.^2-y.^2);
> [C,h]=contourf(x,y,z);
> clabel2(C,h)
>
>
> were clabel2 is my modified clabel function, and the inequality from
> the fisrt post is changed to:
> if xywh(1)>0

which ML ver do you use(?)...
unfortunately, r2010a yields an error in your CLABEL2()...

rect=get(h,'Extent');
%{
??? Error using ==> get
There is no 'Extent' property in the 'contourgroup' class.
%}

us
From: Adam Chapman on
On Jul 26, 1:18 pm, "us " <u...(a)neurol.unizh.ch> wrote:
> Adam Chapman
>
> > an example:
>
> > [x,y] = meshgrid(-2:.2:2);
> > z = x.^exp(-x.^2-y.^2);
> > [C,h]=contourf(x,y,z);
> > clabel2(C,h)
>
> > were clabel2 is my modified clabel function, and the inequality from
> > the fisrt post is changed to:
> > if xywh(1)>0
>
> which ML ver do you use(?)...
> unfortunately, r2010a yields an error in your CLABEL2()...
>
>      rect=get(h,'Extent');
> %{
> ??? Error using ==> get
> There is no 'Extent' property in the 'contourgroup' class.
> %}
>
> us

Thanks for trying.

Im using verion 2007b. Do you get the same error when putting this in
the command window:

a=clabel(C,h)
get(a,'HandleVisibility')