next up previous contents
Next: 2.1.3.5 Scatter Plots Up: 2.1.3 Other 2-D plots Previous: 2.1.3.3 Plots with error   Contents

2.1.3.4 Parametric plots

In a parametric plot, the two plotting coordinates (say $x$ and $y$) are a function of a third variable. In other words, the two plotting coordinates are both dependent variables of a third independent coordinate. Here is an example where $x$ and $y$ are both functions of $t$.
% Plotting parametrically
close all; clear all;
t = linspace(0,3*pi,100); % 50 equally spaced points between 0 and pi
x = t.*cos(t);     % Again, the .* means multiply element by element
y = t.*sin(t);     % rather than matrix or vector multiplication
plot(x,y)
axis equal % Make the scaling the same on both axes
Note that no special MATLAB command was needed to make the parametric plot--the data was merely defined differently from a ``normal'' $y=f(x)$ plot.

Gus Hart 2005-01-28