- use text() to write stuff into the overlay and use export_fig() to save the axes as an image, or
- use the textInserter of the Computer Vision System Toolbox to burn text directly into the image and then save the image with imwrite().
Is it possible to make figure caption?
조회 수: 30 (최근 30일)
이전 댓글 표시
I would like to save my plot as a png image but with text caption under it. I would like to make a big paragraph caption with the same width as the whole figure. Is it possible to make it under MATLAB?
댓글 수: 0
답변 (2개)
Image Analyst
2015년 5월 19일
One way is to stitch some blank lines onto the bottom of the image, then
댓글 수: 1
Star Strider
2015년 5월 19일
the annotation('textbox',[x y w h]) function is another option. See the Annotation documentation for details.
Scott MacKenzie
2021년 4월 1일
편집: Scott MacKenzie
2021년 4월 1일
To elaborated on Image Analyst's "stitch some blank lines", here's what worked for me. For the x-axis label, use something like this:
ax = gca;
ax.XLabel.String = sprintf('X Axis Label\n\n\n\n');
The newline characters create some additional empty space below the figure. Then use the text function to add your caption in that space.
댓글 수: 1
Image Analyst
2021년 4월 1일
Yes, and then he can use exportgraphics() (in r2020a and later) to save the axes or figure to disk.
참고 항목
카테고리
Help Center 및 File Exchange에서 Printing and Saving에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!