![Page 1: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/1.jpg)
Octave Graphics
![Page 2: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/2.jpg)
Types of Plots
Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons Animation
![Page 3: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/3.jpg)
Line/Symbol Plot
![Page 4: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/4.jpg)
Line Plots
![Page 5: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/5.jpg)
(1) plot [Line/Symbol Plot ]
Also called as XY plot where y varies with x. Syntax: plot(y) % y varies with x as index (1,2,3..)
plot(x,y) % y varies with x as solid line
plot(x,y,fmt) % fmt is line and color
specifications
Where 'x' is the data for X axis and 'y' is the dependent variable.
![Page 6: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/6.jpg)
x = [0:5:100];
y = x;
plot(x, y)
Example 1
![Page 7: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/7.jpg)
x = [-100:5:100];
y = x.^2;
plot(x, y)
Example 2
![Page 8: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/8.jpg)
Example 3
x = [0:0.01:10];
y = sin(x);
plot(x, y)
xlabel('x')
ylabel('Sin(x)')
title('Sin(x) Graph')
grid on
axis equal
![Page 9: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/9.jpg)
Line/symbol specifications
Three options: Line style Symbol color
![Page 10: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/10.jpg)
![Page 11: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/11.jpg)
![Page 12: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/12.jpg)
![Page 13: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/13.jpg)
Example
![Page 14: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/14.jpg)
Additional options:
LineWidth — Specifies the width (in points) of the
Line.
MarkerSize — Specifies the size of the marker in
points (must be greater than 0).
![Page 15: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/15.jpg)
Example
![Page 16: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/16.jpg)
Adding Title & Axis Labels
Command Purpose Syntax
=============================================
title to add title title('text')
xlabel X axis label xlabel('text')
ylabel Y axis label ylabel('text')
![Page 17: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/17.jpg)
Axis commands
axis equal : same scale
axis square : square plot
axis tight :
grid on : have grid
axis ( [xmin xmax ymin ymax] )
![Page 18: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/18.jpg)
Multiple lines
x = [0 : 0.01: 10];
y = sin(x);
g = cos(x);
plot(x, y, x, g, '.-')
legend('Sin(x)', 'Cos(x)')
![Page 19: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/19.jpg)
'subplot' : More plots in a page
The subplot command is used for creating several plots in a page.
Each plot is a subplot. Syntax:
subplot(m,n,p)
where m, n are number of rows and columns and p specifies the position of the respective plot.
![Page 20: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/20.jpg)
Example: create 1x2 plotx=0:360;
y=sin(x*pi/180);
z=cos(x*pi/180);
subplot(1,2,1) % first position
plot(x,y)
subplot(1,2,2) % second position
plot(x,z)
![Page 21: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/21.jpg)
Example: 4 plotssubplot(2,2,1)
plot(...)
subplot(2,2,2)
plot(...)
subplot(2,2,3)
plot(...)
subplot(2,2,4)
plot(...)
![Page 22: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/22.jpg)
(2) plot3 [3D line plot]
Syntax:
plot3(X1,Y1,Z1,...)
plot3(X1,Y1,Z1,LineSpec,...)
plot3(...,'PropertyName',PropertyValue,...)
plot3(ax,...)
h = plot3(...)
![Page 23: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/23.jpg)
Example
t = 0:pi/50:10*pi;
st = sin(t);
ct = cos(t);
figure
plot3(st,ct,t)
![Page 24: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/24.jpg)
(3) loglog
Syntax:loglog(Y)
loglog(X1,Y1,...)
loglog(X1,Y1,LineSpec,...)
loglog(...,'PropertyName',PropertyValue,...)
loglog(ax,...)
h = loglog(...)
![Page 25: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/25.jpg)
Example
x = logspace(-1,2);
y = exp(x);
loglog(x,y,'-s')
grid on
![Page 26: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/26.jpg)
(4) semilogx
Syntax:
semilogx(Y)
semilogx(X1,Y1,...)
semilogx(X1,Y1,LineSpec,...)
semilogx(...,'PropertyName',PropertyValue,...)
semilogx(ax,...)
h = semilogx(...)
![Page 27: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/27.jpg)
Example
x = 0:1000;
y = log(x);
figure
semilogx(x,y)
![Page 28: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/28.jpg)
(5) semilogy
x = 0:0.1:10;
y = exp(x);
figure
semilogy(x,y)
![Page 29: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/29.jpg)
(6) errorbar
![Page 30: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/30.jpg)
errorbar(x,y,err) plots y versus x and draws a vertical error bar at each
data point.
![Page 31: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/31.jpg)
x = 1:10:100;
y = [20 30 45 40 60 65 80 75 95 90];
err = 8*ones(size(y));
errorbar(x,y,err)
![Page 32: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/32.jpg)
Options
Horizontal errorbar:
errorbar(x, y, err, 'horizontal')
Vertical and Horizontal errorbar:
errorbar(x, y, err, 'both')
![Page 33: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/33.jpg)
(2) Bar Plot
![Page 34: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/34.jpg)
![Page 35: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/35.jpg)
'bar' command
![Page 36: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/36.jpg)
Example1 (Only y)
![Page 37: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/37.jpg)
Example2 (x & y)
![Page 38: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/38.jpg)
Example3 (speficy bar width)
![Page 39: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/39.jpg)
Example – 4 (groups)
![Page 40: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/40.jpg)
Example – 5 (stacked)
![Page 41: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/41.jpg)
Example – 6 (bar color)
![Page 42: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/42.jpg)
'bar3' command
Draws a threedimensional bar graph.
Syntax:bar3(Y)
bar3(x,Y)
bar3(...,width)
bar3(...,'style')
bar3(...,LineSpec)
bar3(axes_handle,...)
h = bar3(...)
![Page 43: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/43.jpg)
Example
load count.dat
Y = count(1:10,:);
figure
bar3(Y)
title('Detached Style')
![Page 44: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/44.jpg)
'barh' command
Plot bar graph horizontally
Syntax:barh(y)
barh(x,y)
barh(...,width)
barh(...,style)
barh(...,'bar_color')
barh(...,'PropertyName',PropertyValue,...)
barh(ax,...)
b = barh(...)
![Page 45: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/45.jpg)
Example
Y = [57,91, ...281.4];
figure
barh(y)
![Page 46: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/46.jpg)
'bar3h'
![Page 47: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/47.jpg)
Histograms
![Page 48: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/48.jpg)
Functions
![Page 49: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/49.jpg)
histogram
![Page 50: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/50.jpg)
x = randn(10000,1);
h = histogram(x)
![Page 51: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/51.jpg)
'histogram2'
![Page 52: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/52.jpg)
Pie Plot
![Page 53: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/53.jpg)
Syntax: pie(X)
example
pie(X,explode)
example
pie(X,labels)
example
pie(X,explode,labels)
example
pie(ax,___)
example
p = pie(___)
![Page 54: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/54.jpg)
X = [1 3 0.5 2.5 2];
pie(X)
![Page 55: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/55.jpg)
explode = [0 1 0 1 0];
pie(X,explode)
![Page 56: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/56.jpg)
pie3
![Page 57: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/57.jpg)
Scatter Plot
![Page 58: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/58.jpg)
![Page 59: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/59.jpg)
![Page 60: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/60.jpg)
Example: circles with different sizes
![Page 61: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/61.jpg)
Example: filled
![Page 62: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/62.jpg)
![Page 63: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/63.jpg)
![Page 64: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/64.jpg)
Polar Plot
![Page 65: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/65.jpg)
Functions
![Page 66: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/66.jpg)
polarplot
![Page 67: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/67.jpg)
polarscatter
![Page 68: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/68.jpg)
polarhistogram
![Page 69: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/69.jpg)
Contour Plot
![Page 70: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/70.jpg)
Functions
![Page 71: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/71.jpg)
contour function
[X,Y,Z] = peaks;
figure
contour(X,Y,Z,20)
![Page 72: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/72.jpg)
contourf function
Z = peaks(20);
contourf(Z,10)
![Page 73: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/73.jpg)
clabel
[x,y,z] = peaks;
[C,h] = contour(x,y,z);
clabel(C,h)
![Page 74: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/74.jpg)
Vector Plot
![Page 75: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/75.jpg)
Functions
![Page 76: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/76.jpg)
'feather' command
theta = -pi/2:pi/16:pi/2;
r = 2*ones(size(theta));
[u,v] = pol2cart(theta,r);
feather(u,v)
![Page 77: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/77.jpg)
'quiver' function
[x,y] = meshgrid(0:0.2:2,0:0.2:2);
u = cos(x).*y;
v = sin(x).*y;
figure
quiver(x,y,u,v)
![Page 78: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/78.jpg)
'compass' function
rng(0,'twister') % initialize random number generator
M = randn(20,20);
Z = eig(M);
figure
compass(Z)
![Page 79: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/79.jpg)
streamline
Not yet implemented in octave
![Page 80: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/80.jpg)
Animations
![Page 81: Octave Graphicsdpo.cusat.ac.in/tutorial/octave/slide/plot.pdf · Types of Plots Line Plots Pie chart, bar plot, histograms Polar plot Contour plot Vector plot Surface, volumes, polygons](https://reader030.vdocuments.mx/reader030/viewer/2022040205/5f29f6b6e0743a62f2110e7a/html5/thumbnails/81.jpg)
Functions