[Scilab-users] Plotting a graph ...

Reinaldo rei.listas at yahoo.com
Tue Sep 30 04:00:18 CEST 2014



Hi Scilab users,

I plotted a graph, as follows:

clear; clc; function f=myfunction(x) f = 3*cosh(x/3) endfunction // Plot scf(1); clf(1); xdata = linspace ( -5 , 5 , 100 );
ydata = myfunction ( xdata ); plot ( xdata , ydata ); xlabel("$-5\le x\le 5$","fontsize",4,"color","red"); ylabel("y","fontsize",4,"color","red"); title("Function","color", "red","fontsize",4); legend("y = 3 cosh(x/3)");

However, the y-axis starts from 3 to 9. How could I set y-axis from -1 to 9?

In addition, how could I change the colors of following functions f(x), g(x) and h(x)?
clear; clc; function f=myfunction1(x) f = x^3-3*x endfunction function g=myfunction2(x) g = -x endfunction function h=myfunction3(x) h = -x^2 endfunction // Plot scf(1); clf(1); xdata = linspace ( -2 , 2 , 100 );
ydata1 = myfunction1 ( xdata );
ydata2 = myfunction2 ( xdata );
ydata3 = myfunction3 ( xdata ); plot ( xdata , [ydata1; ydata2; ydata3]); xlabel("$-2\le x\le 2$","fontsize",4,"color","red"); ylabel("y","fontsize",4,"color","red"); title("Function","color", "red","fontsize",4); legend("f(x) = x^3-3x", "g(x) = -x","h(x) = -x^2");  // <- How could I show correctly the exponentials of those polinomial functions? I don't like to use on legends "^".

Thank you in advance.
All best,
Reinaldo.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20140929/4645c167/attachment.htm>


More information about the users mailing list