[scilab-Users] Add labels on plot figure
Paul CARRICO
paul.carrico at free.fr
Thu Aug 11 15:02:30 CEST 2011
Thanks
Based on the provided examples, Im near to succeed
I just need to know
how I can modify the tips/text features (bolt, colors, size and so on) !
Regards
Paul
############################################################################
#########
mode(0);
PATH_FILE = get_absolute_file_path("test_datatips.sce");
// function to specify the output format (integer / double / etc. ...)
// only the y values are plotted (double)
function str=mydisplay(curve, pt, index)
str = msprintf('%g',pt(2))
endfunction
A = [ 1 15.36; 2 20.02; 3 50.89; 4 14.2; 5 5.05; 6 9.78; 7 23.005; 8 17.99;
9 16.78; 10 6.065 ];
[nl,nc] = size(A);
scf(1);
drawlater();
xgrid(3);
f = gcf();
f.figure_size = [1000, 1000];
f.background = color(245,245,245);
a = gca();
a.font_size = 2;
a.x_label.font_size = 4;
a.Y_label.font_size = 4;
a.title.font_size = 5;
a.title.text = "DataTips";
a.line_style = 1;
id = [ color(0,0,176);
color(0,176,0);
color(176,0,0);
color(208,0,208);
color(184,134,11);
color(72,118,255);
color(255,215,0);
color(84,255,159);
color(238,0,0)];
plot(A(:,1),A(:,2)) ;
e1 = gce() ;
e1 = e1.children ;
e1.thickness = 2 ;
e1.line_style = 0 ;
e1.foreground = id(1) ;
for i = 1 : nl
t = datatipCreate(e1,A(i,1));
datatipSetDisplay(e1,mydisplay)
datatipSetOrientation(t,"upper right")
end
drawnow();
xs2gif(1,PATH_FILE + '/DataTips.gif')
De : Serge Steer [mailto:Serge.Steer at inria.fr]
Envoyé : jeudi 11 août 2011 12:22
À : users at lists.scilab.org
Objet : Re: [scilab-Users] Add labels on plot figure
I think the datatips tool can help you (note that you can customize the
string displayed)
Serge Steer
INRIA
Le 11/08/2011 12:08, Paul CARRICO a écrit :
Hi All,
Is there a way to automatically add labels on a curve (corresponding to
the y values => see red numbers in the attachment) ?
I add a look in labels_properties but I havent found anything
of course
I can use xstring, nevertheless Ive to manually change the coordinates for
each (different) figures
Regards
Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20110811/27aec23f/attachment.htm>
More information about the users
mailing list