필터 지우기
필터 지우기

Plot markers with equal distance on a linear chart?

조회 수: 2 (최근 30일)
Zeinab Ahmadi93
Zeinab Ahmadi93 2017년 12월 5일
댓글: mounika 2017년 12월 5일
Hello everbody :) Please help me draw the following picture(I should plot the circle and star markers exactly like the picture)
Below is my code but I can't plot my desired chart:
x=[5.98,8.06,10.71];
y=[0,1,0];
plot(x,y);
hold on;
x1=[5.98,8.11,11.01];
y1=[0,1,0];
plot(x1,y1,'b--o');
Thanks in advance:)
  댓글 수: 1
mounika
mounika 2017년 12월 5일
You need to have so many x values to have markers continuously. For example:
x = 0:pi/10:2*pi;
y1 = sin(x);
y2 = sin(x-0.25);
y3 = sin(x-0.5);
figure
plot(x,y1,'g',x,y2,'b--o',x,y3,'c*')
In the above example, x has 21 values, so when this plot is generated you will see 21 markers. I hope this helps!

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by