How do I insert a caption below a figure in Matlab?

370 ビュー (過去 30 日間)
Susan
Susan 2011 年 9 月 26 日
コメント済み: Image Analyst 2022 年 8 月 2 日
I would like to add short captions below my figures, so that the captions are part of the same file. Is there a way to do this in Matlab?

回答 (3 件)

Fangjun Jiang
Fangjun Jiang 2011 年 9 月 26 日
Use text() or annotation() function. Or maybe you mean xlabel()
  3 件のコメント
Rhythm Analyst
Rhythm Analyst 2022 年 5 月 15 日
text() and annotation() only seem to be capable of inserting inside a graph, or off to the left/right. Is there a way to put text below the xlabel of the x-axis?
for example:
notice the text "Fig. 3 ..." below the graph. This is what I am trying to achieve in MatLab. Is there a way to do this? Thank you.
Image Analyst
Image Analyst 2022 年 5 月 15 日
You'll have to build a GUI for that. Have an axes, then below it place a static text label. Use sprintf() to build up the string.

サインインしてコメントする。


Michael Leung
Michael Leung 2011 年 9 月 26 日

Image Analyst
Image Analyst 2022 年 5 月 15 日
xlabel('This is my caption');
  2 件のコメント
emjey
emjey 2022 年 8 月 2 日
How is this a figure caption?
Image Analyst
Image Analyst 2022 年 8 月 2 日
@emjey It's not. It's a caption below the bottom edge of the axes box, so it's like an caption for the x-axis. But when @Susan said she wanted "short captions below my figures" I figured that an x-axis caption was what she wanted. In MATLAB the whole window is called the "figure" and images/graphs are in "axes" controls. So you see that there cannot really be anything outside the figure since that would be outside of any window that MATLAB creates, in essence it might be over the desktop or some other application that MATLAB has no control over. So the only way is to put anything and everything inside a "figure", not below it. So that's why we all figured she really meant "axes" instead of "figure".

サインインしてコメントする。

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by