How can I locate the legend of specific points close to each of them in a plot ?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
José Alfonso Farías Fuentes
el 15 de Ag. de 2021
Comentada: José Alfonso Farías Fuentes
el 15 de Ag. de 2021
I want to plot the legend of each point close to those as in this example, but I couldn´t. Thanks in advance.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/712177/image.png)
Respuestas (1)
Chunru
el 15 de Ag. de 2021
You can use "text" command to accomplish it. Code below show you the idea:
% Generate some data (similar but different from yours)
theta = 22.5:45:360;
x = cosd(theta); y=sind(theta);
l = "T"+(1:length(theta)); % specify label
plot(x, y, 'o');
text(x+0.03, y, l)
Ver también
Categorías
Más información sobre Legend en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!