How to put textbox in same position of the plots
Mostrar comentarios más antiguos
I have two plot in a same figure. I need to set text box containing '(a)' and '(b)' in the plots. I can just put them using Insert command but I need the text box to be in the same position of their respective plot (e.g.-bottom left). I have already used legend command once to define the graphs inside the plot. What command and code can I use for this. The code to generate the figure is:
t2=0:0.001:2
a=1*sin(2*pi*5*t2)
b=0.5*sin(2*pi*5*t2)
t = tiledlayout(1,2,'TileSpacing','Compact','Padding','compact');
nexttile
plot(t2,a,'g',LineWidth=5)
legend('First wave')
ylim([-3 3])
ax = gca;
ax.GridLineWidth = 1.5;
ax.GridLineStyle = '--';
ax.GridAlpha = 0.9;
ax.LineWidth=4;
ax.FontWeight = 'bold';
nexttile
plot(t2,b,'r-.')
legend('Second wave')
ylim([-3 3])
ax = gca;
ax.GridLineWidth = 1.5;
ax.GridLineStyle = '--';
ax.GridAlpha = 0.9;
ax.LineWidth=4;
ax.FontWeight = 'bold';
I have attached a image to have the better understanding of my requirement. 

Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Graphics Performance 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!
