From: us on 26 Jul 2010 08:34 Adam Chapman <adamchapman1985(a)hotmail.co.uk> wrote in message <00da692a-f6e7-4114-afc2-bebf8eab3224(a)d17g2000yqb.googlegroups.com>... > 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') no... this works fine... A is an array of handles to the TEXT objects - all without Z-information, however... us
From: Adam Chapman on 26 Jul 2010 08:38 On Jul 26, 1:34 pm, "us " <u...(a)neurol.unizh.ch> wrote: > Adam Chapman <adamchapman1...(a)hotmail.co.uk> wrote in message <00da692a-f6e7-4114-afc2-bebf8eab3...(a)d17g2000yqb.googlegroups.com>... > > 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') > > no... this works fine... > A is an array of handles to the TEXT objects - all without Z-information, however... > > us- Hide quoted text - > > - Show quoted text - yes, in my version of clabel, h is an array of handles to text objects, set with: ch = varargin{1}; varargin(1) = []; set(ch,'ShowText','on'); h = findobj(ch,'type','text'); within the original clabel code. I've definately turned the "HandleVisibility" property off for some labels, but they still show up on the figure
From: us on 26 Jul 2010 08:47 Adam Chapman > I've definately turned the "HandleVisibility" property off for some > labels, but they still show up on the figure why do you use the HANDLEVISIBILITY prop(?)... it refers to/does something different... here's what works with r2010a... [x,y]=meshgrid(-2:.2:2); z=x.^exp(-x.^2-y.^2); [c,h]=contourf(x,y,z); ch=clabel(c,h); set(ch([1:10,20:end]),'visible','off'); us
From: Steve Amphlett on 26 Jul 2010 08:49 Adam Chapman <adamchapman1985(a)hotmail.co.uk> wrote in message <35a5a083-6810-4506-b662-c219ec44c5e8(a)j8g2000yqd.googlegroups.com>... > On Jul 26, 1:34 pm, "us " <u...(a)neurol.unizh.ch> wrote: > > Adam Chapman <adamchapman1...(a)hotmail.co.uk> wrote in message <00da692a-f6e7-4114-afc2-bebf8eab3...(a)d17g2000yqb.googlegroups.com>... > > > 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') > > > > no... this works fine... > > A is an array of handles to the TEXT objects - all without Z-information, however... > > > > us- Hide quoted text - > > > > - Show quoted text - > > yes, in my version of clabel, h is an array of handles to text > objects, set with: > > > ch = varargin{1}; > varargin(1) = []; > set(ch,'ShowText','on'); > h = findobj(ch,'type','text'); > > within the original clabel code. > > > I've definately turned the "HandleVisibility" property off for some > labels, but they still show up on the figure Isn't it just the 'visible' property that needs to be 'off' ?
From: Steven_Lord on 26 Jul 2010 09:31 "Adam Chapman" <adamchapman1985(a)hotmail.co.uk> wrote in message news: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. Oh, it's worked. It hasn't done what you expect because the HandleVisibility property doesn't do what you think it does. http://www.mathworks.com/access/helpdesk/help/techdoc/ref/text_props.html#HandleVisibility It really only affects in what scope the handle can be "found" by searching. The property you want to change to make it so the label is no longer displayed is Visible. http://www.mathworks.com/access/helpdesk/help/techdoc/ref/text_props.html#Visible And yes, in a perfect world those two properties would use the same form, either both Visible or both Visibility. > 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? -- Steve Lord slord(a)mathworks.com comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ To contact Technical Support use the Contact Us link on http://www.mathworks.com
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 Prev: how do we find the coefficient of symbolic expression? Next: MatLab GUI, image rotate |