How to add extra text to plot legend?
183 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Giuseppe
el 11 de Mzo. de 2022
Respondida: Kiran Felix Robert
el 15 de Mzo. de 2022
Hi, guys
Let us suppose that I have the following simple code:
clc; clear all; close all;
x = linspace(0, 2*pi, 100);
figure
hold on;grid on; box on;
plot(x,sin(x));
plot(x, cos(x));
plot(x, tan(x));
axis([0 2*pi -4 4]);
legend('sin', 'cos', 'tan');
My goal is to add some extra text in the legend box as shown in the following image example (image modified with gimp):
Can you help me to codify this task?
2 comentarios
Respuesta aceptada
Kiran Felix Robert
el 15 de Mzo. de 2022
Hi Guiseppe,
Please refer the legend properties documentation and the following MATLAB Answer post for legend positioning.
0 comentarios
Más respuestas (0)
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!