<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt"><div><span><span>Hi Samuel,</span></div><div><span></span> </div><div><span>And how can I do to keep the title "Y-axis on the left" and the title "X-axis bellow" ? </span></div><div><span></span> </div><div><span>Run the code:</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(131, 67, 16); font-weight: bold;">x</span><span style="color: rgb(92, 92, 92);">*</span><span style="color: rgb(50, 185, 185);">sin</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(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);">10</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);">10</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(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);">y_location</span><span style="color: rgb(92, 92, 92);">=</span><span style="color: rgb(188, 143, 143);">"</span><span style="color: rgb(188, 143, 143);">middle</span><span style="color: rgb(188, 143, 143);">"</span><span style="color: rgb(0, 0, 0);">;</span> <span style="color: rgb(1, 168, 1); font-style: italic;">// Here X-axis displays in the centre of graph </span>
<span style="color: rgb(0, 0, 0);">b</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);">b</span><span style="color: rgb(92, 92, 92);">.</span><span style="color: rgb(170, 170, 170);">x_location</span><span style="color: rgb(92, 92, 92);">=</span><span style="color: rgb(188, 143, 143);">"</span><span style="color: rgb(188, 143, 143);">middle</span><span style="color: rgb(188, 143, 143);">"</span><span style="color: rgb(0, 0, 0);">;</span> <span style="color: rgb(1, 168, 1); font-style: italic;">// Here Y-axis displays in the centre of graph</span>
<span style="color: rgb(1, 168, 1); font-style: italic;">//drawaxis(x=x_inicial:x_final,y=0,dir=</span><span style="color: rgb(1, 168, 1); font-style: italic;">'</span><span style="color: rgb(1, 168, 1); font-style: italic;">d</span><span style="color: rgb(1, 168, 1); font-style: italic;">'</span><span style="color: rgb(1, 168, 1); font-style: italic;">,tics=</span><span style="color: rgb(1, 168, 1); font-style: italic;">'</span><span style="color: rgb(1, 168, 1); font-style: italic;">v</span><span style="color: rgb(1, 168, 1); font-style: italic;">'</span><span style="color: rgb(1, 168, 1); font-style: italic;">); //Here X-axis displays</span>
<span style="color: rgb(1, 168, 1); font-style: italic;">//drawaxis(y=-6:0.5:8,x=0,dir=</span><span style="color: rgb(1, 168, 1); font-style: italic;">'</span><span style="color: rgb(1, 168, 1); font-style: italic;">r</span><span style="color: rgb(1, 168, 1); font-style: italic;">'</span><span style="color: rgb(1, 168, 1); font-style: italic;">,tics=</span><span style="color: rgb(1, 168, 1); font-style: italic;">'</span><span style="color: rgb(1, 168, 1); font-style: italic;">v</span><span style="color: rgb(1, 168, 1); font-style: italic;">'</span><span style="color: rgb(1, 168, 1); font-style: italic;">,sub_int=2);</span>
<span style="color: rgb(1, 168, 1); font-style: italic;">//drawaxis(y=y_inicial:y_final,x=0,dir=</span><span style="color: rgb(1, 168, 1); font-style: italic;">'</span><span style="color: rgb(1, 168, 1); font-style: italic;">r</span><span style="color: rgb(1, 168, 1); font-style: italic;">'</span><span style="color: rgb(1, 168, 1); font-style: italic;">,tics=</span><span style="color: rgb(1, 168, 1); font-style: italic;">'</span><span style="color: rgb(1, 168, 1); font-style: italic;">v</span><span style="color: rgb(1, 168, 1); font-style: italic;">'</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);">x sin(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><div> </div><div>Thank you.</div><div> </div><div>Reinaldo.</div></span></span></div></body></html>