Can I call this plot as Contour plot?

Hello all,
Refer to the code below
clear all;
x=sin(2*pi*1000*((0:0.1:200)/10000));
y=cos(2*pi*1000*((0:0.1:200)/10000));
figure
plot(x,y)
xlabel ('Values of Sine');
ylabel('Values of Cos');
Can I call the plot I obtain as "Contour plot of x & y" ? What plot it is exactly?

 채택된 답변

Matt Tearle
Matt Tearle 2011년 3월 19일

1 개 추천

What you're doing is called a parametric plot - x(t) against y(t) for a parameter variable t.

댓글 수: 5

Raviteja
Raviteja 2011년 3월 19일
then when a plot is called contour plot?
Matt Tearle
Matt Tearle 2011년 3월 19일
A contour plot is a method for visualizing a scalar function of two variables: z = f(x,y). The contours are curves defined by setting z equal to a fixed value: f(x,y) = c
You can use a contour plot to visualize an implicitly-defined function f(x,y) = c by looking for just the single contour at level c.
Raviteja
Raviteja 2011년 3월 20일
Thank Matt,
For the given sine and cos wave, can you give an example of contour plot in matlab.You take any simple example to explore the above concept you told.
Thanks for this.
Jiro Doke
Jiro Doke 2011년 3월 20일
Have you looked at the documentation for "contour"? It has a couple of examples.
http://www.mathworks.com/help/matlab/ref/contour.html
Matt Tearle
Matt Tearle 2011년 3월 20일
Ok, so x^2 + 2y^2 = 5 is an equation for an ellipse. Two ways to plot this in MATLAB:
Parametrically
t = linspace(0,2*pi);
x = cos(t)*sqrt(5);
y = sin(t)*sqrt(5/2);
plot(x,y)
Using contours
[x,y] = meshgrid(linspace(-2.5,2.5));
z = x.^2 + 2*y.^2;
contour(x,y,z,[5 5])

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Sean de Wolski
Sean de Wolski 2011년 3월 19일

1 개 추천

Sure:
%your stuff followed by:
title('Contour plot of x & y');

댓글 수: 1

Matt Tearle
Matt Tearle 2011년 3월 19일
::rimshot:: Thank you, you've been great. Don't forget to tip your waiter.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Contour Plots에 대해 자세히 알아보기

태그

질문:

2011년 3월 19일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by