How to use LaTeX interpreter for aligning words within an xlabel for a tilelayout?

조회 수: 5(최근 30일)
Dominik Mattioli
Dominik Mattioli 2021년 9월 10일
댓글: dpb 2021년 9월 10일
f = figure();
t = tiledlayout( 3, 1 );
a = gobjects( 3, 1 );
for idx = 1:3
% Plot some stuff in each subplot tile.
a( idx ) = nexttile( idx );
% Give each their own unique xlabels.
xlabel( gca, ['xlabel for axis: ', num2str( idx )] );
end
%
title( t, '\underline{title using latex formatting}', 'Interpreter', 'Latex' );
ylabel( t, 'A Y-Label that applies to all of my tiles', 'Interpreter', 'Latex' );
xlabel( t, 'Left Text\qquad{}\qquad{}\qquad{}Center Text\qquad{}\qquad{}\qquad{}Right Text', 'Interpreter', 'Latex'); % Ad-hoc, not standardized.
Is there a better way to do this? Ideally, "Left Text" is fully left-justified, "Center Text" is centered, and "Right Text" is fully right-justified. There's likely a LaTeX package that does it, but I don't know what it is and I doubt that MATLAB has it imported.
  댓글 수: 1
dpb
dpb 2021년 9월 10일
I dunno about "better", but probably easiest would be to just use text to place the xlabel text where you wish for each section.

댓글을 달려면 로그인하십시오.

답변(0개)

Community Treasure Hunt

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

Start Hunting!

Translated by