필터 지우기
필터 지우기

Align text of different entries in legend

조회 수: 14 (최근 30일)
Marcel345614
Marcel345614 2021년 7월 5일
답변: Scott MacKenzie 2021년 7월 5일
How can I align the text of different entries in the legend, e.g. align it with respect to the dot ?
legend('h=1.5m','h=10.5m','h=100.5m')
Thanks a lot!

채택된 답변

Scott MacKenzie
Scott MacKenzie 2021년 7월 5일
A simple solution is to use a sans serif font, such as courier, and pad with spaces:
% test data
d = rand(3,5);
bar(d');
labels = { ' h=1.5 m',' h=10.5 m','h=100.5 m' };
h = legend(labels, 'fontname', 'courier', 'fontweight', 'b');

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Legend에 대해 자세히 알아보기

태그

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by