필터 지우기
필터 지우기

How do I use Saveas function to save figure2 ?

조회 수: 2 (최근 30일)
HARSHA M BHONSLE
HARSHA M BHONSLE 2023년 5월 19일
답변: Walter Roberson 2023년 5월 19일
I have a Matlab code with multiple figures present in it.But I want to save Figure 2 as a jpg format.
I have seen people using "saveas(gcf,'Barchart.png')" and gcf is used for getting the current Fig. But I want only Figure2 to be saved as Barchart.png and not any other figure.

채택된 답변

Walter Roberson
Walter Roberson 2023년 5월 19일
saveas(2,'filename.jpg')
For more security,
fig2 = figure(2);
saveas(fig2, 'filename.jpg')
.. you should probably have a handle to the figure anyway, as you need to use the handle in some operations to ensure that you are working with the figure you want.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Graphics Object Identification에 대해 자세히 알아보기

태그

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by