# parametric plot with values of parameter on plot

10 views (last 30 days)

Show older comments

##### 1 Comment

Salaheddin Hosseinzadeh
on 19 Mar 2014

Oh! Now I see what you're looking for. Unfortunately I don't know about an automated solution, all I can think of, is to write my own code to add annotations or text to the graph! But I don't think if that's gonna be ver usefull and beneficial code for me! :(

Sorry!

### Answers (2)

Mischa Kim
on 19 Mar 2014

Edited: Mischa Kim
on 19 Mar 2014

Mohsen, would this do (using ticks and tick labels)?

t = -pi:.1:pi;

y = sin(t);

plot(t,y)

set(gca,'XTick',-pi:pi/2:pi)

set(gca,'XTickLabel',{'t=-pi','t=-pi/2','t=0','t=pi/2','t=pi'})

mehran
on 20 Sep 2023

t = linspace(0, 10*pi, 500);

x = 3*t.*cos(t);

y = 3*t.*sin(t);

figure(3);

plot(x,y);

hold on;

vec1=1:20:floor(length(t)/2);

vec2=floor(length(t)/2)+1:10:length(t);

vec=[vec1 vec2];

for ii = 1:length(vec)

txt=sprintf('t=%4.2f',t(ii));

text(x(vec(ii)), y(vec(ii)),txt, 'HorizontalAlignment','left');

end

xlabel('x');

ylabel('y');

title('spiral parametric curve with sample parameter values shown')

##### 0 Comments

### See Also

### Categories

### Products

### Community Treasure Hunt

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

Start Hunting!