[Scilab-users] Leading Spaces in xstring

Samuel Gougeon sgougeon at free.fr
Thu Aug 10 14:20:26 CEST 2017


Hi Richard,

Le 10/08/2017 à 13:58, Richard llom a écrit :
> Hey All,
> I have this code to print some information in the graph:
> // Save info as string
> infobox(1) = msprintf('Min V      %.2f V \n',min(log_data(:,3)));
> infobox(2) = msprintf('Max V      %.2f V \n',max(log_data(:,3)));
> infobox(3) = msprintf('Capacity   %.2f Ah\n',amphrs);
> infobox(4) = msprintf('           %.2f Wh\n',watthrs);
> // Print info as box on the figure
> xstring(1,0.1,infobox,0,1);
> boxh = gce();
> boxh.font_style = 0; // Set monospace font

I agree, this forced trimming is often annoying.
There is here an easy workaround: use a 2-column matrix instead of a 
unique column:

t  =  ["abc"   "def"
      "ghij"  "kl"
      ""      "mn"
      ];
xstring(1,0.1,t,0,1);

HTH Samuel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20170810/13ef0c36/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cbonfkgpjlhondlk.png
Type: image/png
Size: 1342 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20170810/13ef0c36/attachment.png>


More information about the users mailing list