Effacer les filtres
Effacer les filtres

How to reduce space between plots in subplot?

34 vues (au cours des 30 derniers jours)
Jamie Al
Jamie Al le 20 Jan 2023
Réponse apportée : KSSV le 20 Jan 2023
How can I reduce the space between my plots? Here's my code:
Lx = 640;
Ly = 640;
Lz = 640;
E3d=(readmatrix('...txt'));
E2d=(readmatrix('...txt'));
time3Col = (readmatrix('...txt'));
time2Col = (readmatrix('...txt'));
fontSize = 16;
f = figure();
subplot(1,3,1)
semilogy(time3Col, (E3d)/(Lx*Ly*Lz),'LineWidth',2,'DisplayName','E');
hold on;
semilogy(time2Col, (E2d)/(Lx*Ly),'LineWidth',2,'DisplayName','E');
grid on;
ylabel('Energy (J)');
E3dC=(readmatrix('...txt'));
E2dC=(readmatrix('...txt'));
time3C = (readmatrix('...txt'));
time2C = (readmatrix('...txt'));
subplot(1,3,2)
semilogy(time3C, (E3dC)/(Lx*Ly*Lz),'LineWidth',2,'DisplayName','E');
hold on;
semilogy(time2C, (E2dC)/(Lx*Ly),'LineWidth',2,'DisplayName','E');
grid on;
yticklabels('');
xlabel('time (s)');
E3dI=(readmatrix('...txt'));
E2dI=(readmatrix('...txt'));
time3In = (readmatrix('...txt'));
time2In = (readmatrix('...txt'));
subplot(1,3,3)
semilogy(time3In, (E3dI)/(Lx*Ly*Lz),'LineWidth',2,'DisplayName','E');
hold on;
semilogy(time2In, (E2dI)/(Lx*Ly),'LineWidth',2,'DisplayName','E');
grid on;
yticklabels('');
What I get something like this:
But the space between plots is so large.

Réponse acceptée

KSSV
KSSV le 20 Jan 2023
You may also have a look on tiledlayout.

Plus de réponses (0)

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by