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

Erhy erhard.glueck.austria at gmail.com
Mon Mar 27 11:59:49 CEST 2017


Hello!
If I plot curves where some values are %nan
datatips are not shown if the curve point for the tip is surrounded by %nan
values.
Now I code on Version 6.0.0
<http://mailinglists.scilab.org/file/n4036034/datatipbsp.png> 
My code:
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_blue, 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-tp4036034.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.



More information about the users mailing list