Borrar filtros
Borrar filtros

How to reduce space between plots in subplot?

34 visualizaciones (últimos 30 días)
Jamie Al
Jamie Al el 20 de En. de 2023
Respondida: KSSV el 20 de En. de 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.

Respuesta aceptada

KSSV
KSSV el 20 de En. de 2023
You may also have a look on tiledlayout.

Más respuestas (0)

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by