Clear Filters
Clear Filters

How to reduce space between plots in subplot?

34 views (last 30 days)
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.

Accepted Answer

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

More Answers (0)

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!