[Scilab-users] Sprintf and Italic font.

Marcus Vinicius Pereira de Souza marcusvpsouza at yahoo.com.br
Mon Mar 18 01:56:09 CET 2019


Dear all,Kindly, I am generating a graphic and would like some information in the title to be in italics. Can someone help me?
By way of illustration, see the script below:clc;
clear;

A=[2 4;-4 2/4]
b=[10;0]
K=inv(A)*b
kp1=K(1)
kp2=K(2)

t=[0:0.01:5]
y=-kp1*exp(-1/2*t) + kp1*cos(4*t) + kp2*sin(4*t);

xset('window',0)

xset('font size',2.5)  
xgrid(0.25)

plot2d(t,y,[2],"011",rect=[0,min(y)-1,t($),max(y)+1]) // 
p=get("hdl");
p.children.thickness=4;

a = gca();  
a.x_label.font_size = 4;  
a.y_label.font_size = 4;  
a.title.font_size = 4;
a.x_label.text = "$t(s)$"
a.y_label.text = "$y(t)$"

title(sprintf('y(t) = -%0.2f exp(-0.5t)\ + %0.2f cos(4t)\ + %0.2f sin(4t) ',kp1,kp1,kp2))y(t) --> italic fontexp --> italic fontcos --> italic fontsin --> italic font.
Thank you very much for your attention.Best wishes,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20190318/b7802b39/attachment.htm>


More information about the users mailing list