<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">Hello Federico,</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">Le 20/08/2020 à 18:18, Federico Miyara
a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:2b13c61a-91e2-b4c4-6464-fa00298213a2@fceia.unr.edu.ar">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<br>
<font face="Courier New">Dear all, <br>
<br>
When plotting some data the axes present ticks labelled with
numbers. However, the digits of the different numbers on the
same axis may differ, for instance 0.8, 0.9, 1, 1.1. It would be
better if the default presentation were 0.8, 0.9, 1.0, 1.1. Is
there a way to set this as a default?<br>
</font></blockquote>
<p>Yes:<br>
</p>
<p><font size="+1" face="monospace">--> gca().ticks_format(1) =
"%.1f";</font></p>
<p>Because of the <a moz-do-not-send="true"
href="http://bugzilla.scilab.org/14790">bug 14790</a>, new ticks
labels are not rendered. But there is a work-around:</p>
<p><br>
<font size="+1" face="monospace">--> a = gca();
a.x_ticks.labels(1) = a.x_ticks.labels(1);</font></p>
<p>forces displaying new ticks labels.<br>
As an expected side effect, this automatically sets
a.auto_ticks(1) = "off", but labels are well formatted.<br>
Example:</p>
<pre style="font-family:Monospaced;font-style:normal;font-size:14.0;"><span style="color:rgb(0,0,0);">x</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(188,143,143);">0</span><span style="color:rgb(255,170,0);">:</span><span style="color:rgb(188,143,143);">0.1</span><span style="color:rgb(255,170,0);">:</span><span style="color:rgb(188,143,143);">2</span><span style="color:rgb(0,0,0);">;</span>
<span style="color:rgb(174,92,176);text-decoration:underline;">plot</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(0,0,0);">x</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(50,185,185);">sin</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(188,143,143);">5</span><span style="color:rgb(92,92,92);">*</span><span style="color:rgb(0,0,0);">x</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(74,85,219);">)</span>
<span style="color:rgb(0,0,0);">a</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(174,92,176);text-decoration:underline;">gca</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(0,0,0);">;</span> <span style="color:rgb(0,0,0);">
a</span><span style="color:rgb(92,92,92);">.</span><span style="color:rgb(170,170,170);">ticks_format</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(188,143,143);">1</span><span style="color:rgb(74,85,219);">)</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">%.1f</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(0,0,0);">;</span>
<span style="color:rgb(0,0,0);">a</span><span style="color:rgb(92,92,92);">.</span><span style="color:rgb(170,170,170);">x_ticks</span><span style="color:rgb(92,92,92);">.</span><span style="color:rgb(170,170,170);">labels</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(188,143,143);">1</span><span style="color:rgb(74,85,219);">)</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(0,0,0);">a</span><span style="color:rgb(92,92,92);">.</span><span style="color:rgb(170,170,170);">x_ticks</span><span style="color:rgb(92,92,92);">.</span><span style="color:rgb(170,170,170);">labels</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(188,143,143);">1</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(0,0,0);">;
<img src="cid:part2.B317CA56.A42D8CEF@free.fr" alt="">
HTH
Samuel
</span></pre>
</body>
</html>