how to have the same plot area size when some axis names become 2 lines

1 回表示 (過去 30 日間)
Asliddin Komilov
Asliddin Komilov 2020 年 2 月 12 日
コメント済み: Stephen23 2020 年 2 月 13 日
I am generating plots with different axis names, and when long names become 2 lines they make the plot area smaller, but I need the plot area to be the same for all my plots.
thanks
P.S. each plot is plotted separately, not at once.

採用された回答

Walter Roberson
Walter Roberson 2020 年 2 月 12 日
You could control InnerPosition property and OuterPosition property to force all of the plots to have the smaller size so that both have room for the words. There would be empty space in the one-line case but the area would be consistent.
Or you could detect the long line case and set the fontsize smaller

その他の回答 (2 件)

KSSV
KSSV 2020 年 2 月 12 日
編集済み: KSSV 2020 年 2 月 12 日
Use like this:
plot(rand(1,100))
title({'First line';'Second line'})
xlabel({'First line';'Second line'})
ylabel({'First line';'Second line'})

Asliddin Komilov
Asliddin Komilov 2020 年 2 月 13 日
Ok having two lines in the axis name does the job, thanks

カテゴリ

Help Center および File ExchangeLine Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by