How to put the legend in a subplot?

6 visualizaciones (últimos 30 días)
Clodoaldo de Souza Faria Júnior
Clodoaldo de Souza Faria Júnior el 31 de Ag. de 2021
Respondida: Star Strider el 31 de Ag. de 2021
I have a subplot with 6 columns and 2 rows, but I only have 11 charts. I would like to put my caption in the space that is left blank.

Respuestas (1)

Star Strider
Star Strider el 31 de Ag. de 2021
One approach —
x = 1:10;
y = rand(11,10);
NrSbp = size(y,1);
figure
for k = 1:NrSbp
subplot(6,2,k)
plot(x, y(k,:))
grid
xlabel('x')
ylabel('y')
title(sprintf('Subplot %2d',k))
end
subplot(6,2,k+1)
text(0.5, 0.5, sprintf('Put Caption Here'), 'Horiz','center', 'Vert','middle')
Ax = gca;
Ax.XAxis.Color = 'none';
Ax.YAxis.Color = 'none';
Make appropriate changes to get the result you want.
.

Categorías

Más información sobre Line Plots en Help Center y File Exchange.

Productos


Versión

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by