<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt"><div><span>Hi again,</span></div><div><span></span> </div><div><span>For example: in the following Scilab code, how could I move the Y-axis to the centre of graph ?</span></div><div><span></span> </div><span><pre style="font-family: Monospaced; font-style: normal;"><span style="color: rgb(176, 24, 19);">function</span> <span style="color: rgb(131, 67, 16); font-weight: bold;">f</span><span style="color: rgb(92, 92, 92);">=</span><span style="color: rgb(0, 0, 0); text-decoration: underline;">funcao</span><span style="color: rgb(74, 85, 219);">(</span><span style="color: rgb(131, 67, 16); font-weight: bold;">x</span><span style="color: rgb(74, 85, 219);">)</span>
<span style="color: rgb(131, 67, 16); font-weight: bold;">f</span> <span style="color: rgb(92, 92, 92);">=</span> <span style="color: rgb(188, 143, 143);">1</span><span style="color: rgb(92, 92, 92);">/</span><span style="color: rgb(131, 67, 16); font-weight: bold;">x</span><span style="color: rgb(0, 0, 0);">;</span>
<span style="color: rgb(176, 24, 19);">endfunction</span>
<span style="color: rgb(0, 0, 0);">x_inicial</span> <span style="color: rgb(92, 92, 92);">=</span> <span style="color: rgb(92, 92, 92);">-</span><span style="color: rgb(188, 143, 143);">1</span><span style="color: rgb(0, 0, 0);">;</span>
<span style="color: rgb(0, 0, 0);">x_final</span> <span style="color: rgb(92, 92, 92);">=</span> <span style="color: rgb(188, 143, 143);">1</span><span style="color: rgb(0, 0, 0);">;</span>
<span style="color: rgb(0, 0, 0);">n</span> <span style="color: rgb(92, 92, 92);">=</span> <span style="color: rgb(188, 143, 143);">100</span><span style="color: rgb(0, 0, 0);">;</span> <span style="color: rgb(1, 168, 1); font-style: italic;">// number of points</span>
<span style="color: rgb(0, 0, 0);">xdata</span> <span style="color: rgb(92, 92, 92);">=</span> <span style="color: rgb(174, 92, 176); text-decoration: underline;">linspace</span> <span style="color: rgb(74, 85, 219);">(</span> <span style="color: rgb(0, 0, 0);">x_inicial</span> <span style="color: rgb(0, 0, 0);">,</span> <span style="color: rgb(0, 0, 0);">x_final</span><span style="color: rgb(0, 0, 0);">,</span> <span style="color: rgb(0, 0, 0);">n</span><span style="color: rgb(74, 85, 219);">)</span><span style="color: rgb(0, 0, 0);">;</span>
<span style="color: rgb(160, 32, 240);">for</span> <span style="color: rgb(0, 0, 0);">i</span> <span style="color: rgb(92, 92, 92);">=</span> <span style="color: rgb(188, 143, 143);">1</span><span style="color: rgb(255, 170, 0);">:</span><span style="color: rgb(0, 0, 0);">n</span>
<span style="color: rgb(0, 0, 0);">f1</span><span style="color: rgb(74, 85, 219);">(</span><span style="color: rgb(0, 0, 0);">i</span><span style="color: rgb(74, 85, 219);">)</span> <span style="color: rgb(92, 92, 92);">=</span> <span style="color: rgb(0, 0, 0); text-decoration: underline;">funcao</span><span style="color: rgb(74, 85, 219);">(</span><span style="color: rgb(0, 0, 0);">xdata</span><span style="color: rgb(74, 85, 219);">(</span><span style="color: rgb(0, 0, 0);">i</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(160, 32, 240);">end</span>
<span style="color: rgb(0, 0, 0);">y_inicial</span> <span style="color: rgb(92, 92, 92);">=</span> <span style="color: rgb(50, 185, 185);">min</span><span style="color: rgb(74, 85, 219);">(</span><span style="color: rgb(0, 0, 0);">f1</span><span style="color: rgb(74, 85, 219);">)</span><span style="color: rgb(0, 0, 0);">;</span>
<span style="color: rgb(0, 0, 0);">y_final</span> <span style="color: rgb(92, 92, 92);">=</span> <span style="color: rgb(50, 185, 185);">max</span><span style="color: rgb(74, 85, 219);">(</span><span style="color: rgb(0, 0, 0);">f1</span><span style="color: rgb(74, 85, 219);">)</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);">xdata</span><span style="color: rgb(0, 0, 0);">,</span> <span style="color: rgb(0, 0, 0); text-decoration: underline;">funcao</span><span style="color: rgb(74, 85, 219);">)</span>
<span style="color: rgb(50, 185, 185);">xgrid</span><span style="color: rgb(74, 85, 219);">(</span><span style="color: rgb(174, 92, 176); text-decoration: underline;">color</span><span style="color: rgb(74, 85, 219);">(</span><span style="color: rgb(188, 143, 143);">"</span><span style="color: rgb(188, 143, 143);">grey</span><span style="color: rgb(188, 143, 143);">"</span><span style="color: rgb(74, 85, 219);">)</span><span style="color: rgb(74, 85, 219);">)</span>
<span style="color: rgb(50, 185, 185);">xtitle</span> <span style="color: rgb(74, 85, 219);">(</span> <span style="color: rgb(188, 143, 143);">"</span><span style="color: rgb(188, 143, 143);">Função</span><span style="color: rgb(188, 143, 143);">"</span> <span style="color: rgb(0, 0, 0);">,</span> <span style="color: rgb(188, 143, 143);">"</span><span style="color: rgb(188, 143, 143);">X axis </span><span style="color: rgb(188, 143, 143);">"</span> <span style="color: rgb(0, 0, 0);">,</span> <span style="color: rgb(188, 143, 143);">"</span><span style="color: rgb(188, 143, 143);">Y axis </span><span style="color: rgb(188, 143, 143);">"</span> <span style="color: rgb(74, 85, 219);">)</span><span style="color: rgb(0, 0, 0);">;</span>
<span style="color: rgb(50, 185, 185);">drawaxis</span><span style="color: rgb(74, 85, 219);">(</span><span style="color: rgb(0, 0, 0);">x</span><span style="color: rgb(92, 92, 92);">=</span><span style="color: rgb(0, 0, 0);">x_inicial</span><span style="color: rgb(255, 170, 0);">:</span><span style="color: rgb(188, 143, 143);">0.5</span><span style="color: rgb(255, 170, 0);">:</span><span style="color: rgb(0, 0, 0);">x_final</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(0, 0, 0);">y</span><span style="color: rgb(92, 92, 92);">=</span><span style="color: rgb(188, 143, 143);">0</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(174, 92, 176); text-decoration: underline;">dir</span><span style="color: rgb(92, 92, 92);">=</span><span style="color: rgb(188, 143, 143);">'</span><span style="color: rgb(188, 143, 143);">d</span><span style="color: rgb(188, 143, 143);">'</span><span style="color: rgb(0, 0,
0);">,</span><span style="color: rgb(0, 0, 0);">tics</span><span style="color: rgb(92, 92, 92);">=</span><span style="color: rgb(188, 143, 143);">'</span><span style="color: rgb(188, 143, 143);">v</span><span style="color: rgb(188, 143, 143);">'</span><span style="color: rgb(74, 85, 219);">)</span><span style="color: rgb(0, 0, 0);">;</span> <span style="color: rgb(1, 168, 1); font-style: italic;">//Here X-axis displays</span>
<span style="color: rgb(174, 92, 176); text-decoration: underline;">legend</span> <span style="color: rgb(74, 85, 219);">(</span> <span style="color: rgb(188, 143, 143);">"</span><span style="color: rgb(188, 143, 143);">y = 1/x</span><span style="color: rgb(188, 143, 143);">"</span> <span style="color: rgb(74, 85, 219);">)</span><span style="color: rgb(0, 0, 0);">;</span></pre></span><div><span></span><font size="2" face="Arial"></font> </div><div><font size="2" face="Arial">Thank you in advance.</font></div><div><font size="2" face="Arial"></font> </div><div><font size="2" face="Arial">All best,</font></div><div><font size="2" face="Arial">Reinaldo.</font></div><div> </div><div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"><div id="yiv1187136613"><div style="color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif;
font-size: 10pt; background-color: rgb(255, 255, 255);"><div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"><div id="yiv1187136613"><div style="color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif; font-size: 10pt; background-color: rgb(255, 255, 255);"><div><font size="2" face="Arial"></font> </div><div><font size="2" face="Arial">----- Forwarded Message -----<br><b><span style="font-weight: bold;">From:</span></b> Sumit Adhikari <sumit.adhikari@gmail.com><br><b><span style="font-weight: bold;">To:</span></b> users@lists.scilab.org<br><b><span style="font-weight: bold;">Sent:</span></b> Saturday, June 25, 2011 4:09 PM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [scilab-Users] Drawing Y-axis in graph<br></font><br></div><div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"><div
style="font-family: times new roman, new york, times, serif; font-size: 12pt;">
<div id="yiv1187136613">That is what I see! Please check the attached pdf file for what I see<div>Regards,</div><div><br></div><div><br>-- <br>Sumit Adhikari,<br>Institute of Computer Technology,<br>Faculty of Electrical Engineering,<br>Vienna University of Technology,<br>
Gußhausstraße 27-29,1040 Vienna</div><div><br></div><div><br><br><div class="yiv1187136613gmail_quote">On Sat, Jun 25, 2011 at 9:04 PM, Prof. Dr. Reinaldo Golmia Dante <span dir="ltr"><<a href="mailto:tiraduvidascefet@yahoo.com" rel="nofollow" target="_blank" ymailto="mailto:tiraduvidascefet@yahoo.com">tiraduvidascefet@yahoo.com</a>></span> wrote:<br>
<blockquote style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;" class="yiv1187136613gmail_quote"><div><div style="color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif; font-size: 10pt; background-color: rgb(255, 255, 255);"><div><span></span><font size="2" face="Arial">Hi Sumit,</font></div>
<div><font size="2" face="Arial"></font> </div><div><font size="2" face="Arial">Do you see Y-axis at x = 0 ?</font></div><div><font size="2" face="Arial"></font> </div><div><font size="2" face="Arial">I don't see it ...</font></div>
<div><font size="2" face="Arial"></font> </div><div><font size="2" face="Arial">Regards,</font></div><div><font size="2" face="Arial">Reinaldo.</font></div><div><font size="2" face="Arial"> </font></div><div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt;">
<div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"><div style="margin: 5px 0px; padding: 0px; border: 1px solid rgb(204, 204, 204); line-height: 0; font-size: 0px;"></div><b><span style="font-weight: bold;">From:</span></b> Sumit Adhikari <<a href="mailto:sumit.adhikari@gmail.com" rel="nofollow" target="_blank" ymailto="mailto:sumit.adhikari@gmail.com">sumit.adhikari@gmail.com</a>><br>
<b><span style="font-weight: bold;">To:</span></b> <a href="mailto:users@lists.scilab.org" rel="nofollow" target="_blank" ymailto="mailto:users@lists.scilab.org">users@lists.scilab.org</a><br><b><span style="font-weight: bold;">Sent:</span></b> Saturday, June 25, 2011 3:18 PM<br>
<b><span style="font-weight: bold;">Subject:</span></b> Re: [scilab-Users] Drawing Y-axis in graph<div><div></div><div class="yiv1187136613h5"><br><br>
<div>But I see Y-axis in your plot on my scilab!<div><br></div><div>Regards,<br>-- <br>Sumit Adhikari,<br>Institute of Computer Technology,<br>Faculty of Electrical Engineering,<br>Vienna University of Technology,<br>Gußhausstraße 27-29,1040 Vienna<br>
<div><br><br><div>On Sat, Jun 25, 2011 at 8:01 PM, Prof. Dr. Reinaldo Golmia Dante <span dir="ltr"><<a href="mailto:tiraduvidascefet@yahoo.com" rel="nofollow" target="_blank" ymailto="mailto:tiraduvidascefet@yahoo.com">tiraduvidascefet@yahoo.com</a>></span> wrote:<br>
<blockquote style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;">
<div><div style="color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif; font-size: 10pt; background-color: rgb(255, 255, 255);"><div><span>Dear Scilab users,</span></div><div><span></span> </div><div><span>I would like to draw Y-axis in a graph, but it does not display !</span></div>
<div><span></span> </div><div><span>See the Scilab-codes:</span></div><div><span><span style="color: rgb(0, 0, 0);"><font color="#b01813"></font></span></span> </div><span><span style="color: rgb(0, 0, 0);"><pre style="font-family: Monospaced; font-style: normal;"><span style="color: rgb(176, 24, 19);">function</span> <span style="color: rgb(131, 67, 16); font-weight: bold;">f</span><span style="color: rgb(92, 92, 92);">=</span><span style="color: rgb(0, 0, 0); text-decoration: underline;">funcao</span><span style="color: rgb(74, 85, 219);">(</span><span style="color: rgb(131, 67, 16); font-weight: bold;">x</span><span style="color: rgb(74, 85, 219);">)</span>
<span style="color: rgb(131, 67, 16); font-weight: bold;">f</span> <span style="color: rgb(92, 92, 92);">=</span> <span style="color: rgb(188, 143, 143);">2</span><span style="color: rgb(92, 92, 92);">*</span><span style="color: rgb(131, 67, 16); font-weight: bold;">x</span><span style="color: rgb(92, 92, 92);">*</span><span style="color: rgb(50, 185, 185);">exp</span><span style="color: rgb(74, 85, 219);">(</span><span style="color: rgb(92, 92, 92);">-</span><span style="color: rgb(131, 67, 16); font-weight: bold;">x</span><span style="color: rgb(92, 92, 92);">^</span><span style="color: rgb(188, 143, 143);">2</span><span style="color: rgb(74, 85, 219);">)</span><span style="color: rgb(0, 0, 0);">;</span>
<span style="color: rgb(176, 24, 19);">endfunction</span>
<span style="color: rgb(0, 0, 0);">x_inicial</span> <span style="color: rgb(92, 92, 92);">=</span> <span style="color: rgb(92, 92, 92);">-</span><span style="color: rgb(188, 143, 143);">4</span>
<span style="color: rgb(0, 0, 0);">x_final</span> <span style="color: rgb(92, 92, 92);">=</span> <span style="color: rgb(188, 143, 143);">4</span>
<span style="color: rgb(0, 0, 0);">xdata</span> <span style="color: rgb(92, 92, 92);">=</span> <span style="color: rgb(174, 92, 176); text-decoration: underline;">linspace</span> <span style="color: rgb(74, 85, 219);">(</span> <span style="color: rgb(0, 0, 0);">x_inicial</span> <span style="color: rgb(0, 0, 0);">,</span> <span style="color: rgb(0, 0, 0);">x_final</span><span style="color: rgb(0, 0, 0);">,</span> <span style="color: rgb(188, 143, 143);">100</span><span style="color: rgb(74, 85, 219);">)</span><span style="color: rgb(0, 0, 0);">;</span>
<span style="color: rgb(0, 0, 0);">y_inicial</span> <span style="color: rgb(92, 92, 92);">=</span> <span style="color: rgb(92, 92, 92);">-</span><span style="color: rgb(188, 143, 143);">1.0</span><span style="color: rgb(0, 0, 0);">;</span>
<span style="color: rgb(0, 0, 0);">y_final</span> <span style="color: rgb(92, 92, 92);">=</span> <span style="color: rgb(188, 143, 143);">1.0</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);">xdata</span><span style="color: rgb(0, 0, 0);">,</span> <span style="color: rgb(0, 0, 0); text-decoration: underline;">funcao</span><span style="color: rgb(74, 85, 219);">)</span>
<span style="color: rgb(50, 185, 185);">xtitle</span> <span style="color: rgb(74, 85, 219);">(</span> <span style="color: rgb(188, 143, 143);">"</span><span style="color: rgb(188, 143, 143);">Função</span><span style="color: rgb(188, 143, 143);">"</span> <span style="color: rgb(0, 0, 0);">,</span> <span style="color: rgb(188, 143, 143);">"</span><span style="color: rgb(188, 143, 143);">X axis </span><span style="color: rgb(188, 143, 143);">"</span> <span style="color: rgb(0, 0, 0);">,</span> <span style="color: rgb(188, 143, 143);">"</span><span style="color: rgb(188, 143, 143);">Y axis </span><span style="color: rgb(188, 143, 143);">"</span> <span style="color: rgb(74, 85, 219);">)</span><span style="color: rgb(0, 0, 0);">;</span>
<span style="color: rgb(50, 185, 185);">drawaxis</span><span style="color: rgb(74, 85, 219);">(</span><span style="color: rgb(0, 0, 0);">x</span><span style="color: rgb(92, 92, 92);">=</span><span style="color: rgb(0, 0, 0);">x_inicial</span><span style="color: rgb(255, 170, 0);">:</span><span style="color: rgb(0, 0, 0);">x_final</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(0, 0, 0);">y</span><span style="color: rgb(92, 92, 92);">=</span><span style="color: rgb(188, 143, 143);">0</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(174, 92, 176); text-decoration: underline;">dir</span><span style="color: rgb(92, 92, 92);">=</span><span style="color: rgb(188, 143, 143);">'</span><span style="color: rgb(188, 143, 143);">d</span><span style="color: rgb(188, 143, 143);">'</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(0, 0, 0);">tics</span><span style="color: rgb(92, 92,
92);">=</span><span style="color: rgb(188, 143, 143);">'</span><span style="color: rgb(188, 143, 143);">v</span><span style="color: rgb(188, 143, 143);">'</span><span style="color: rgb(74, 85, 219);">)</span><span style="color: rgb(0, 0, 0);">;</span> <span style="color: rgb(1, 168, 1); font-style: italic;">//Here X-axis displays</span>
<span style="color: rgb(50, 185, 185);">drawaxis</span><span style="color: rgb(74, 85, 219);">(</span><span style="color: rgb(0, 0, 0);">y</span><span style="color: rgb(92, 92, 92);">=</span><span style="color: rgb(0, 0, 0);">y_inicial</span><span style="color: rgb(255, 170, 0);">:</span><span style="color: rgb(0, 0, 0);">y_final</span><span style="color: rgb(0, 0, 0);">,</span><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(0, 0, 0);">,</span><span style="color: rgb(174, 92, 176); text-decoration: underline;">dir</span><span style="color: rgb(92, 92, 92);">=</span><span style="color: rgb(188, 143, 143);">'</span><span style="color: rgb(188, 143, 143);">d</span><span style="color: rgb(188, 143, 143);">'</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(0, 0, 0);">tics</span><span style="color: rgb(92, 92,
92);">=</span><span style="color: rgb(188, 143, 143);">'</span><span style="color: rgb(188, 143, 143);">v</span><span style="color: rgb(188, 143, 143);">'</span><span style="color: rgb(74, 85, 219);">)</span><span style="color: rgb(0, 0, 0);">;</span> <span style="color: rgb(1, 168, 1); font-style: italic;">// I try to do the same, but Y-axis does not display :-(((</span>
<span style="color: rgb(174, 92, 176); text-decoration: underline;">legend</span> <span style="color: rgb(74, 85, 219);">(</span> <span style="color: rgb(188, 143, 143);">"</span><span style="color: rgb(188, 143, 143);">2*x*exp(-x^2)</span><span style="color: rgb(188, 143, 143);">"</span> <span style="color: rgb(74, 85, 219);">)</span><span style="color: rgb(0, 0, 0);">;</span></pre>
</span></span><span><span style="color: rgb(0, 0, 0);"><font color="#000000">I appreciate your comments.</font></span></span><pre style="font-family: Monospaced; font-style: normal;"><span><span style="color: rgb(0, 0, 0);">Thank you in advance.</span></span></pre>
<pre style="font-family: Monospaced; font-style: normal;"><span><span style="color: rgb(0, 0, 0);">All best,</span></span></pre><pre style="font-family: Monospaced; font-style: normal;"><span><span style="color: rgb(0, 0, 0);">Reinaldo.</span></span></pre>
</div></div></blockquote></div><br><br clear="all"><br>
</div></div>
</div><br><br></div></div></div></div></div></div></div></blockquote></div><br><br clear="all"><br>
</div>
</div><br><br></div></div></div></div></div><br><br></div></div></div></div></div><br><br></div></div></div></div></body></html>