<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt"><div><span>wow .. good suggestion !!</span> </div><div> </div><div>Samuel,</div><div> </div><div>do you know why the Y-axis at x = 0 doesn't cover the range (y_inicial, y_final) ?</div><div> </div><div>If you run the following scrip you will see that the Y-axis goes until 0.1 ! I have no idea !</div><div> </div><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);">;</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);">;</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);">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);">r</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 Y-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);">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><div> </div><div> </div><div>Tnx</div><div>Reinaldo.</div><div><font size="2" face="Arial"> </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;" class="hr" contentEditable="false" readonly="true"></div><b><span style="font-weight: bold;">From:</span></b> Samuel GOUGEON <Samuel.Gougeon@univ-lemans.fr><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:39 PM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [scilab-Users] Drawing Y-axis in graph<br></font><br>
<div id="yiv1329169859">

  

    
  
  
    ----- Message d'origine ----- <br>
    De : Prof. Dr. Reinaldo Golmia Dante <br>
    Date : 25/06/2011 21:33:
    <blockquote type="cite">
      <div style="color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif; font-size: 10pt; background-color: rgb(255, 255, 255);">
        <div><span>I would like to have both.</span></div>
        <div><span></span> </div>
        <div><span>Some students have difficult to understand graphs
            using only Y-axis on the corner. For that reason,</span></div>
        <div><span>it is interesting to have Y-axis at x = 0.</span></div>
      </div>
    </blockquote>
    But you can also use grids instead:<br>
    xgrid(color("grey"))<br>
    This may be clear enough for students<br>
    <br>
    Samuel<br>
    <br>
  

</div><br><br></div></div></div></div></body></html>