How to include labels to a plot?
Mostrar comentarios más antiguos
So I have some coordinates and I want to include some labels on my plot.
force = 30;
displacement = [10 20 30 40];
cases = ['This is case 1' 'This is case 2' 'This is case 3' 'This is case 4'];
plot (force, displacement, 'x')
for i =1:length(displacement)
text(force, displacement(i), ['\leftarrow ', cases(i)]);
end
I know the problem is with either line 3 or line 6 because cases is saved as char and when I call cases(i) in line 6 it displays only the individual characters instead of everything that is inside the quotation(' ') marks. Does anyone know how to fix this?
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Polar Plots en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
