Vertical blank space in tiledlayout compact
Dear all
I am plotting the following:
u1=figure(‘visible’,’off’,’units’,’pixels’,’position’,[0 0 1920 1080]);
t=tiledlayout(2,2,’Padding’,’compact’);
title(t,[‘Bilayer. Monte Carlo, $15$ million steps. $T=2$ K, $mathbf{H}=0$’;”;”],’FontSize’,18,’interpreter’,’latex’);
ax1=nexttile;
uimagesc(space_x,space_y,mx);
axis xy;
clim([-round(max([abs(max(max(mx))) abs(min(min(mx)))]),2) round(max([abs(max(max(mx))) abs(min(min(mx)))]),2)]);
colormap(ax1,bluewhitered(256));
box on;
clr1=colorbar(‘YTick’,[-round(max([abs(max(max(mx))) abs(min(min(mx)))]),2) -round(max([abs(max(max(mx))) abs(min(min(mx)))])/2,2) 0 round(max([abs(max(max(mx))) abs(min(min(mx)))])/2,2) round(max([abs(max(max(mx))) abs(min(min(mx)))]),2)]);
set(clr1,’TickLabelInterpreter’,’latex’);
xlabel(‘$a$-{it th} spatial direction, $a , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(‘$b$-{it th} spatial direction, $b , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(clr1,’$a$-{it th} magnetization component, $m_a$’,’Interpreter’,’Latex’,’FontSize’,16);
xlim([0 300]);
xticks([0:50:300]);
ylim([0 100]);
yticks([0:20:100]);
pbaspect([1 1/3 1]);
xtickangle(0);
set(gca,’TickLabelInterpreter’,’latex’,’FontSize’,15);
ax2=nexttile;
uimagesc(space_x,space_y,my);
clim([-max([abs(max(max(my))) abs(min(min(my)))]) max([abs(max(max(my))) abs(min(min(my)))])]);
colormap(ax2,bluewhitered(256));
axis xy;
box on;
clr2=colorbar(‘YTick’,[-max([abs(max(max(my))) abs(min(min(my)))]) -max([abs(max(max(my))) abs(min(min(my)))])/2 0 max([abs(max(max(my))) abs(min(min(my)))])/2 max([abs(max(max(my))) abs(min(min(my)))])]);
set(clr2,’TickLabelInterpreter’,’latex’);
xlabel(‘$a$-{it th} spatial direction, $a , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(‘$b$-{it th} spatial direction, $b , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(clr2,’$b$-{it th} magnetization component, $m_b$’,’Interpreter’,’Latex’,’FontSize’,16);
xlim([0 300]);
xticks([0:50:300]);
ylim([0 100]);
yticks([0:20:100]);
pbaspect([1 1/3 1]);
xtickangle(0);
set(gca,’TickLabelInterpreter’,’latex’,’FontSize’,15);
ax3=nexttile;
uimagesc(space_x,space_y,mz);
box on;
axis xy;
clim([-max([abs(max(max(mz))) abs(min(min(mz)))]) max([abs(max(max(mz))) abs(min(min(mz)))])]);
colormap(ax3,bluewhitered(256));
clr3=colorbar(‘YTick’,[-max([abs(max(max(mz))) abs(min(min(mz)))]) -max([abs(max(max(mz))) abs(min(min(mz)))])/2 0 max([abs(max(max(mz))) abs(min(min(mz)))])/2 max([abs(max(max(mz))) abs(min(min(mz)))])]);
set(clr3,’TickLabelInterpreter’,’latex’);
xlabel(‘$a$-{it th} spatial direction, $a , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(‘$b$-{it th} spatial direction, $b , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(clr3,’$z$-{it th} magnetization component, $m_z$’,’Interpreter’,’Latex’,’FontSize’,16);
xlim([0 300]);
xticks([0:50:300]);
ylim([0 100]);
yticks([0:20:100]);
pbaspect([1 1/3 1]);
xtickangle(0);
set(gca,’TickLabelInterpreter’,’latex’,’FontSize’,15);
ax4=nexttile;
uimagesc(space_x,space_y,total_magnetization);
box on;
axis xy;
clim([0 max(max(total_magnetization))]);
colormap(ax4,cmap);
clr4=colorbar(‘YTick’,[0 max(max(total_magnetization))/5 2*max(max(total_magnetization))/5 3*max(max(total_magnetization))/5 4*max(max(total_magnetization))/5 max(max(total_magnetization))]);
set(clr4,’TickLabelInterpreter’,’latex’);
xlabel(‘$a$-{it th} spatial direction, $a , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(‘$b$-{it th} spatial direction, $b , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(clr4,’Magnetization vector modulus, $left| mathbf{m} right|$’,’Interpreter’,’Latex’,’FontSize’,16);
xlim([0 300]);
xticks([0:50:300]);
ylim([0 100]);
yticks([0:20:100]);
pbaspect([1 1/3 1]);
xtickangle(0);
set(gca,’TickLabelInterpreter’,’latex’,’FontSize’,15);
set(gcf,’color’,’white’);
set(gca,’Units’,’normalized’);
set(u1,’Units’,’Inches’);
posu1=get(u1,’Position’);
set(u1,’PaperPositionMode’,’Auto’,’PaperUnits’,’Inches’,’PaperSize’,[posu1(3),posu1(4)]);
and the plot looks like:
As you can see there is some vertical unnecessary space between the two horizontal stacks of plots. I would like to reduce it to be able to put the general title "Bilayer…" far enough from the top plots.
Any ideas?Dear all
I am plotting the following:
u1=figure(‘visible’,’off’,’units’,’pixels’,’position’,[0 0 1920 1080]);
t=tiledlayout(2,2,’Padding’,’compact’);
title(t,[‘Bilayer. Monte Carlo, $15$ million steps. $T=2$ K, $mathbf{H}=0$’;”;”],’FontSize’,18,’interpreter’,’latex’);
ax1=nexttile;
uimagesc(space_x,space_y,mx);
axis xy;
clim([-round(max([abs(max(max(mx))) abs(min(min(mx)))]),2) round(max([abs(max(max(mx))) abs(min(min(mx)))]),2)]);
colormap(ax1,bluewhitered(256));
box on;
clr1=colorbar(‘YTick’,[-round(max([abs(max(max(mx))) abs(min(min(mx)))]),2) -round(max([abs(max(max(mx))) abs(min(min(mx)))])/2,2) 0 round(max([abs(max(max(mx))) abs(min(min(mx)))])/2,2) round(max([abs(max(max(mx))) abs(min(min(mx)))]),2)]);
set(clr1,’TickLabelInterpreter’,’latex’);
xlabel(‘$a$-{it th} spatial direction, $a , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(‘$b$-{it th} spatial direction, $b , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(clr1,’$a$-{it th} magnetization component, $m_a$’,’Interpreter’,’Latex’,’FontSize’,16);
xlim([0 300]);
xticks([0:50:300]);
ylim([0 100]);
yticks([0:20:100]);
pbaspect([1 1/3 1]);
xtickangle(0);
set(gca,’TickLabelInterpreter’,’latex’,’FontSize’,15);
ax2=nexttile;
uimagesc(space_x,space_y,my);
clim([-max([abs(max(max(my))) abs(min(min(my)))]) max([abs(max(max(my))) abs(min(min(my)))])]);
colormap(ax2,bluewhitered(256));
axis xy;
box on;
clr2=colorbar(‘YTick’,[-max([abs(max(max(my))) abs(min(min(my)))]) -max([abs(max(max(my))) abs(min(min(my)))])/2 0 max([abs(max(max(my))) abs(min(min(my)))])/2 max([abs(max(max(my))) abs(min(min(my)))])]);
set(clr2,’TickLabelInterpreter’,’latex’);
xlabel(‘$a$-{it th} spatial direction, $a , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(‘$b$-{it th} spatial direction, $b , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(clr2,’$b$-{it th} magnetization component, $m_b$’,’Interpreter’,’Latex’,’FontSize’,16);
xlim([0 300]);
xticks([0:50:300]);
ylim([0 100]);
yticks([0:20:100]);
pbaspect([1 1/3 1]);
xtickangle(0);
set(gca,’TickLabelInterpreter’,’latex’,’FontSize’,15);
ax3=nexttile;
uimagesc(space_x,space_y,mz);
box on;
axis xy;
clim([-max([abs(max(max(mz))) abs(min(min(mz)))]) max([abs(max(max(mz))) abs(min(min(mz)))])]);
colormap(ax3,bluewhitered(256));
clr3=colorbar(‘YTick’,[-max([abs(max(max(mz))) abs(min(min(mz)))]) -max([abs(max(max(mz))) abs(min(min(mz)))])/2 0 max([abs(max(max(mz))) abs(min(min(mz)))])/2 max([abs(max(max(mz))) abs(min(min(mz)))])]);
set(clr3,’TickLabelInterpreter’,’latex’);
xlabel(‘$a$-{it th} spatial direction, $a , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(‘$b$-{it th} spatial direction, $b , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(clr3,’$z$-{it th} magnetization component, $m_z$’,’Interpreter’,’Latex’,’FontSize’,16);
xlim([0 300]);
xticks([0:50:300]);
ylim([0 100]);
yticks([0:20:100]);
pbaspect([1 1/3 1]);
xtickangle(0);
set(gca,’TickLabelInterpreter’,’latex’,’FontSize’,15);
ax4=nexttile;
uimagesc(space_x,space_y,total_magnetization);
box on;
axis xy;
clim([0 max(max(total_magnetization))]);
colormap(ax4,cmap);
clr4=colorbar(‘YTick’,[0 max(max(total_magnetization))/5 2*max(max(total_magnetization))/5 3*max(max(total_magnetization))/5 4*max(max(total_magnetization))/5 max(max(total_magnetization))]);
set(clr4,’TickLabelInterpreter’,’latex’);
xlabel(‘$a$-{it th} spatial direction, $a , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(‘$b$-{it th} spatial direction, $b , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(clr4,’Magnetization vector modulus, $left| mathbf{m} right|$’,’Interpreter’,’Latex’,’FontSize’,16);
xlim([0 300]);
xticks([0:50:300]);
ylim([0 100]);
yticks([0:20:100]);
pbaspect([1 1/3 1]);
xtickangle(0);
set(gca,’TickLabelInterpreter’,’latex’,’FontSize’,15);
set(gcf,’color’,’white’);
set(gca,’Units’,’normalized’);
set(u1,’Units’,’Inches’);
posu1=get(u1,’Position’);
set(u1,’PaperPositionMode’,’Auto’,’PaperUnits’,’Inches’,’PaperSize’,[posu1(3),posu1(4)]);
and the plot looks like:
As you can see there is some vertical unnecessary space between the two horizontal stacks of plots. I would like to reduce it to be able to put the general title "Bilayer…" far enough from the top plots.
Any ideas? Dear all
I am plotting the following:
u1=figure(‘visible’,’off’,’units’,’pixels’,’position’,[0 0 1920 1080]);
t=tiledlayout(2,2,’Padding’,’compact’);
title(t,[‘Bilayer. Monte Carlo, $15$ million steps. $T=2$ K, $mathbf{H}=0$’;”;”],’FontSize’,18,’interpreter’,’latex’);
ax1=nexttile;
uimagesc(space_x,space_y,mx);
axis xy;
clim([-round(max([abs(max(max(mx))) abs(min(min(mx)))]),2) round(max([abs(max(max(mx))) abs(min(min(mx)))]),2)]);
colormap(ax1,bluewhitered(256));
box on;
clr1=colorbar(‘YTick’,[-round(max([abs(max(max(mx))) abs(min(min(mx)))]),2) -round(max([abs(max(max(mx))) abs(min(min(mx)))])/2,2) 0 round(max([abs(max(max(mx))) abs(min(min(mx)))])/2,2) round(max([abs(max(max(mx))) abs(min(min(mx)))]),2)]);
set(clr1,’TickLabelInterpreter’,’latex’);
xlabel(‘$a$-{it th} spatial direction, $a , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(‘$b$-{it th} spatial direction, $b , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(clr1,’$a$-{it th} magnetization component, $m_a$’,’Interpreter’,’Latex’,’FontSize’,16);
xlim([0 300]);
xticks([0:50:300]);
ylim([0 100]);
yticks([0:20:100]);
pbaspect([1 1/3 1]);
xtickangle(0);
set(gca,’TickLabelInterpreter’,’latex’,’FontSize’,15);
ax2=nexttile;
uimagesc(space_x,space_y,my);
clim([-max([abs(max(max(my))) abs(min(min(my)))]) max([abs(max(max(my))) abs(min(min(my)))])]);
colormap(ax2,bluewhitered(256));
axis xy;
box on;
clr2=colorbar(‘YTick’,[-max([abs(max(max(my))) abs(min(min(my)))]) -max([abs(max(max(my))) abs(min(min(my)))])/2 0 max([abs(max(max(my))) abs(min(min(my)))])/2 max([abs(max(max(my))) abs(min(min(my)))])]);
set(clr2,’TickLabelInterpreter’,’latex’);
xlabel(‘$a$-{it th} spatial direction, $a , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(‘$b$-{it th} spatial direction, $b , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(clr2,’$b$-{it th} magnetization component, $m_b$’,’Interpreter’,’Latex’,’FontSize’,16);
xlim([0 300]);
xticks([0:50:300]);
ylim([0 100]);
yticks([0:20:100]);
pbaspect([1 1/3 1]);
xtickangle(0);
set(gca,’TickLabelInterpreter’,’latex’,’FontSize’,15);
ax3=nexttile;
uimagesc(space_x,space_y,mz);
box on;
axis xy;
clim([-max([abs(max(max(mz))) abs(min(min(mz)))]) max([abs(max(max(mz))) abs(min(min(mz)))])]);
colormap(ax3,bluewhitered(256));
clr3=colorbar(‘YTick’,[-max([abs(max(max(mz))) abs(min(min(mz)))]) -max([abs(max(max(mz))) abs(min(min(mz)))])/2 0 max([abs(max(max(mz))) abs(min(min(mz)))])/2 max([abs(max(max(mz))) abs(min(min(mz)))])]);
set(clr3,’TickLabelInterpreter’,’latex’);
xlabel(‘$a$-{it th} spatial direction, $a , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(‘$b$-{it th} spatial direction, $b , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(clr3,’$z$-{it th} magnetization component, $m_z$’,’Interpreter’,’Latex’,’FontSize’,16);
xlim([0 300]);
xticks([0:50:300]);
ylim([0 100]);
yticks([0:20:100]);
pbaspect([1 1/3 1]);
xtickangle(0);
set(gca,’TickLabelInterpreter’,’latex’,’FontSize’,15);
ax4=nexttile;
uimagesc(space_x,space_y,total_magnetization);
box on;
axis xy;
clim([0 max(max(total_magnetization))]);
colormap(ax4,cmap);
clr4=colorbar(‘YTick’,[0 max(max(total_magnetization))/5 2*max(max(total_magnetization))/5 3*max(max(total_magnetization))/5 4*max(max(total_magnetization))/5 max(max(total_magnetization))]);
set(clr4,’TickLabelInterpreter’,’latex’);
xlabel(‘$a$-{it th} spatial direction, $a , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(‘$b$-{it th} spatial direction, $b , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(clr4,’Magnetization vector modulus, $left| mathbf{m} right|$’,’Interpreter’,’Latex’,’FontSize’,16);
xlim([0 300]);
xticks([0:50:300]);
ylim([0 100]);
yticks([0:20:100]);
pbaspect([1 1/3 1]);
xtickangle(0);
set(gca,’TickLabelInterpreter’,’latex’,’FontSize’,15);
set(gcf,’color’,’white’);
set(gca,’Units’,’normalized’);
set(u1,’Units’,’Inches’);
posu1=get(u1,’Position’);
set(u1,’PaperPositionMode’,’Auto’,’PaperUnits’,’Inches’,’PaperSize’,[posu1(3),posu1(4)]);
and the plot looks like:
As you can see there is some vertical unnecessary space between the two horizontal stacks of plots. I would like to reduce it to be able to put the general title "Bilayer…" far enough from the top plots.
Any ideas? padding compact tiledlayout MATLAB Answers — New Questions