Session 8: Plotting Graphs [June 5, 2011, 12:53 p.m.]
Objectives
In this session you will learn the following:
- Plotting 2 dimensional line graphs
- Annotating graphs with grids, axis labels, graph titles
- Exporting graphs for inclusion in documents
- Plotting 3 dimensional surface graphs
- Plotting multiple graphs on one page (subplot())
Functions for Plotting
In this session, we will learn the following functions:
plot(), plot2d(), xgrid(), xtitle(), legend(), plot3d(), linspace()
Plotting Basics
Scilab is a data plotter, that is, it plots graphs from the data you input. 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. 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.
The data to be used to plot the graph(s) can be arranged in one of the following ways:
- Values of independent and dependent variables in two columns (or two rows) of the same variable.
- Values of independent and dependent variables in two different variables. Each may either be a row or a column vector. They must have the same size.
- Independent variable in