[Scilab-users] how to place datatip on one point of polyline

Erhy erhard.glueck.austria at gmail.com
Mon Mar 27 15:15:03 CEST 2017


der_Phil wrote
> yes, indeeed.
> The datatip shows up if you replace the "%nan" by a number...such as:
> 
> y2(TipIx-1) = 0;//%nan;y2(TipIx+1) = 0; //%nan;
> 
> ...not sure if this helps.
> 
> BR
> Philipp

Want also thank you for the last choke, as Austrian I know this choke.

As mentioned it is a demo script in real world script you cannot predict the
values of the curve.

corrected script to evaluate:

function str=ShowTipsmyfmt(h)
pt = h.data;
str = 'where is the tip on the red curve?';
endfunction
function TipIx= ShowTips()
x1=linspace(0,1,32)';
y1=sinc(10*x1);
TipIx = round( length(y1) ./ 2 ); 
y2=zeros(y1);
y2(TipIx-1) = %nan;
y2(TipIx+1) = %nan;
y3=ones(y1) .* %nan ;
y3( TipIx-1 : TipIx+1 ) = 0.4;
clf();
plot2d(x1,[y1,y2,y3], style=[color("black"), color("red"), color("blue")] );
e=gce();
p_blue=e.children(1);
p_blue.mark_style=5;// diamond 
p_red=e.children(2);
p_red.mark_style=1;// + 
p_red.thickness=2;
p_red.mark_foreground=color("red");
if TipIx ~= [] then
t_red=datatipCreate(p_red, TipIx);
datatipSetOrientation(t_red,"upper left")
datatipSetDisplay(t_red,"ShowTipsmyfmt")

t_blue=datatipCreate(p_blue, TipIx);
t_blue.font_foreground=color("blue");
t_blue.font_size=3;
datatipSetOrientation(t_blue,"upper left")
datatipSetDisplay(t_blue,"ShowTipsmyfmt")
end
endfunction





--
View this message in context: http://mailinglists.scilab.org/how-to-place-datatip-on-one-point-of-polyline-tp4036034p4036041.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.



More information about the users mailing list