0% found this document useful (0 votes)
12 views2 pages

Line Plots and 2 D Contour

The document provides instructions for creating 3-D line plots and 2-D contour plots using specific commands in a programming environment. It includes examples with parameterized equations for plotting points in 3-D space and generating contour levels on the XY plane. The document also demonstrates the use of grid, labels, and line specifications in the plots.

Uploaded by

mranonymous11211
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views2 pages

Line Plots and 2 D Contour

The document provides instructions for creating 3-D line plots and 2-D contour plots using specific commands in a programming environment. It includes examples with parameterized equations for plotting points in 3-D space and generating contour levels on the XY plane. The document also demonstrates the use of grid, labels, and line specifications in the plots.

Uploaded by

mranonymous11211
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

LINE PLOTS

A basic 3-D plot is created with the plot3 command.


It has the form :
plot3(x,y,z,’line specifiers’,’PropertyName’,property value)

Example :
Consider the coordinates x,y and z given as a function of the parameter t by
x = √t sin(2t)
y = √t cos(2t)
z = 0.5t
A plot of the points for 0 ≤ t ≤ 6π can be plotted by the following :

t=0:0.0000005:6*pi;
x=sqrt(t).*sin(2*t);
y=sqrt(t).*cos(2*t);
z=0.5*t;
plot3(x,y,z,'r','linewidth',1) %'r' for red
grid on
xlabel('x') ; ylabel('y') ; zlabel('z')

2D CONTOUR PLOT

It draws the projections of contour levels on the XY plane.


Function format : contour (X,Y,Z,n)

Example :
2 + y2)
The function z = 1.8-1.5√(x sin(x)cos(0.5y) over the domain -3 ≤ x ≤ 3 and
-3 ≤ y ≤ 3
x=3:0.01:3;
y=-3:0.01:3;
[X,Y]=meshgrid(x,y);
Z=1.8.^(-1.5*sqrt(x.^2+y.^2)).*cos(0.5*Y).*sin(X);
contour(X,Y,Z,15)
xlabel('x');ylabel('y');zlabel('z')

You might also like