trioscribe.blogg.se

Plot multiple lines on scilab
Plot multiple lines on scilab












plot multiple lines on scilab

To plot 3D graphs, we need (x, y, z) coordinates of points lying on the surface.

plot multiple lines on scilab

While 2D graphs are lines, 3D graphs are surfaces. It displays a tree diagram showing all the components of the graph, and you can interactively modify fonts, font sizes, axis labels, grids etc. To interactively modify the different properties of the graph, click on Edit -> Figure Properties. When the plot() function finishes plotting the graph, you see a graphic window, with its own main menu and the graph shown underneath. Use the online help to learn more about the legend() function. >plot(x, y) xgrid(1) xtitle('Harmonic Functions', 'x', 'sin(x), cos(x)') legend(, 3)įirst argument to legend() is an array of strings containing the legend text and the second argument specifies the position. In the same way, we could define a legend with the legend() function as follows: Using the xtitle() function, we define the title of the graph (first argument), title for the x-axis (second argument) and title for the y-axis (third argument). Using xgrid() function, we tell Scilab to plot grids parallel to the x- and y-axes in black color (argument 1 to the function xgrid()). Since y contains two columns, Scilab understands that it must plot two lines in the graph, one each for each column of values. The number of rows in x and y must be the same. Using the plot() function, we tell Scilab to look for values of x in the first variable (namely x) and look for values of y in the second variable (namely y). This must result in the following graph being plotted: >plot(x, y) xgrid(1) xtitle('Harmonic Functions', 'x', 'sin(x) and cos(x)') Then we will create the matrix y, containing the same number of rows as x, with values of sin(x) in its first column and values of cos(x) in its second column. We will first create vector x, containing the values of the independent variable x. Let us plot a graph of sin(x) and cos(x) over the range x = 0 to 2 pi. Function plotting programs will decide the range of the values of independent variable and its data interval, generate the data on the fly and plot the graph. This is in contrast to function plotting programs (such as gnuplot) which plot graphs of functions without the user having to first explicitly generate the data required to plot the graph. Scilab is a data plotter, that is, it plots graphs from the data you input. In this session, we will learn the following functions: Plotting multiple graphs on one page (subplot()) In this session you will learn the following:Īnnotating graphs with grids, axis labels, graph titlesĮxporting graphs for inclusion in documents














Plot multiple lines on scilab