Студопедия
Случайная страница | ТОМ-1 | ТОМ-2 | ТОМ-3
АвтомобилиАстрономияБиологияГеографияДом и садДругие языкиДругоеИнформатика
ИсторияКультураЛитератураЛогикаМатематикаМедицинаМеталлургияМеханика
ОбразованиеОхрана трудаПедагогикаПолитикаПравоПсихологияРелигияРиторика
СоциологияСпортСтроительствоТехнологияТуризмФизикаФилософияФинансы
ХимияЧерчениеЭкологияЭкономикаЭлектроника

Multiple Data Sets in One Graph

Читайте также:
  1. A Graphical User Interface (GUI) makes computers easier to use. A GUI uses icons. Icons are pictures which represent programs, folders, and files.
  2. A Short Biography
  3. About the Gapminder World Graph
  4. An Example of a Graph Description
  5. Annotated Bibliography
  6. APPLICATIONS OF GRAPHICAL DESIGN, Mechanical Shuttle
  7. Arrange the sentences you have made into a single paragraph.

Multiple x-y pair arguments create multiple graphs with a single call to plot. SCILAB automatically cycles through a predefined (but user settable) list of colors to allow discrimination among sets of data. For example, these statements plot three related functions of x, each curve in a separate distinguishing color.

>>y2 = sin(x-.25);

>>y3 = sin(x-.5);

>>plot(x,y,x,y2,x,y3)

The legend command provides an easy way to identify the individual plots.

>>legend('sin(x)','sin(x-.25)','sin(x-.5)')

Figure 5.2 – Multiple Data Sets in One Graph

Plots of the Parameter Functions

For example, these statements plot function y(t)=0.7cos(t) of x(t)=0.5sin(t), where parameter t € [0, 2π]:

>>t=[0:0.01:2*pi];

>>x=0.5*sin(t);

>>y=0.7*cos(t);

>>plot(x,y)

Plot of the sectionally given function

It is given

These statements plot of the sectionally given function:

>>x1=[-2*pi:0.01:-pi];

>>y1=pi*sin(x1);

>>x2=[-pi:0.01:pi];

>>y2=pi-abs(x2);

>>x3=[pi:0.01:2*pi];

>>y3=pi*sin(x3).^3;

>>x=[x1 x2 x3];

>>y=[y1 y2 y3];

>>plot(x,y)

or

>>plot(x1,y1,x2,y2,x3,y3)

5.3.2 The fplot function

fplot(<nameFunction >, limits) - produces a graph of function in an interval. Where

<nameFunction> - name of a m-file as:

@ MyFun or 'MyFun'

or a line of a kind:

'sin(x)',

'[sin(x) cos(x) ]',

'[sin(x), myfun1(x), myfun2(x)]'.

limits=[xmin xmax ymin ymax] – defines intervals for values of argument and function.

For example:

fplot(@humps,[0 1]);

fplot('humps',[0 1]);

fplot('[tan(x),sin(x),cos(x)]',2*pi*[-1 1 -1 1]);

fplot('sin(1./ x)', [0.01 0.1],1e-3).

Preparing Graphs for Presentation

Specifying Line Styles and Colors

It is possible to specify color, line styles, and markers (such as plus signs or circles) when you plot your data using the plot command.

plot(x,y,'color_style_marker' )

color_style_marker is a string containing from one to four characters (enclosed in single quotation marks) constructed from a color, a line style, and a marker type:

· color strings are 'c', 'm', 'y', 'r', 'g', 'b', 'w', and 'k'. These correspond to cyan, magenta, yellow, red, green, blue, white, and black;

· linestyle strings are '-' for solid, '--' for dashed, ':' for dotted, '-.' For dash-dot. Omit the linestyle for no line;

· the marker types are '+', 'o', '*', and 'x' and the filled marker types are 's' for square, 'd' for diamond, '^' for up triangle, 'v' for down triangle, '>' for right triangle, '<' for left triangle, 'p' for pentagram, 'h' for hexagram, and none for no marker.

You can also edit color, line style, and markers interactively.


Дата добавления: 2015-10-29; просмотров: 145 | Нарушение авторских прав


Читайте в этой же книге: The Basic Opportunities of Spreadsheets | Calculations in Calc. Creating and Coping Formulas | Operators. Expressions use familiar arithmetic operators and precedence rules. | Intrinsic SCILAB Functions | Printing from the Menu | Individual Tasks |
<== предыдущая страница | следующая страница ==>
Examples of Expressions| Plotting Lines and Markers

mybiblioteka.su - 2015-2024 год. (0.004 сек.)