How to reduce space between plots in subplot?
20 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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.
0 Commenti
Risposta accettata
KSSV
il 20 Gen 2023
You may consider using this fileexchange function: https://in.mathworks.com/matlabcentral/fileexchange/27991-tight_subplot-nh-nw-gap-marg_h-marg_w
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Axis Labels in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!