X-label additional text automatically.
2 ビュー (過去 30 日間)
古いコメントを表示
Djordje Damnjanovic
2020 年 12 月 11 日
コメント済み: Star Strider
2020 年 12 月 11 日
Dear all,
I need help about Figures in Matlab. Is it posible to put on x-label two separate texts, for intance one in middle and one od the right edge of figure, but automaticly without command 'text'. For example like in the fig below (I marked it with the red circle):
If I use command xlabel for Frequency then I need to use comand text for (a) and in command tect I need to put cordinates and I do not want to do that for every figure. I need automatical way.
4 件のコメント
dpb
2020 年 12 月 11 日
編集済み: dpb
2020 年 12 月 11 日
" I need to do 30 different positioning of text, ..."
Why is it any different? Looks like the axes would be the same or at least very similar.
You have the x values in order to be able to plot the data, code them in, too...text() uses the axes coordinates for location; at worst you have to work out the y coordinate once to align it vertically where desired.
採用された回答
Star Strider
2020 年 12 月 11 日
Try something like this:
x = 1:10;
y = randn(1,10);
figure
plot(x,y)
xlabel('Frequency [Hz]')
text(max(xlim), min(ylim)-diff(ylim)*0.1, '(a)', 'HorizontalAlignment','right', 'VerticalAlignment','middle')
It seems to work correctly in my simulations, and appears to produce constant relative positioning of ‘(a)’.
6 件のコメント
その他の回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Annotations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!