How to plot more lines of xtick label

41 ビュー (過去 30 日間)
Xiang yu Wang
Xiang yu Wang 2019 年 5 月 16 日
回答済み: Liviu Ivanescu 2020 年 11 月 17 日
xtick label in figure above is some imformation of a satellite with function 'text';
however it's difficult to adjust position 2nd, 3rd,and so on lines of xticklabel using function 'text';
so is there anyway to add multiple lines of xtick label without function 'text'?


Luna 2019 年 5 月 16 日
編集済み: Luna 2019 年 5 月 16 日
Have you tried this function from FEX?
  3 件のコメント
Luna 2020 年 6 月 1 日
Your welcome! :)


その他の回答 (1 件)

Liviu Ivanescu
Liviu Ivanescu 2020 年 11 月 17 日
Try this:
xtick = get(gca,'XTick');
row1 = compose('%3.1f',lat(xtick));
row2 = compose('%3.1f',lon(xtick));
labelArray = [row1; row2];
tickLabels = strtrim(sprintf('%s\\newline%s\n', labelArray{:}));
xlabel('Latitude/Longitude (deg)')


Community Treasure Hunt

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

Start Hunting!

Translated by