Kindly tell me, how I can save the spectrogram without any labels, ticks or surrounding frame area as a JPEG image in my hard drive?

댓글 수: 3

Rik
Rik 2022년 8월 21일
What have you tried?
Sania Gul
Sania Gul 2022년 8월 21일
편집: Sania Gul 2022년 8월 21일
Method # 2 of
and
saveas(gcf,'filename.png')
Although the above link was for part of spectrogram, but I applied it for the full spectrogram.
But it is saving the x and yaxis along with numbers over them and the frame itself.
Sania Gul
Sania Gul 2022년 8월 21일
I have also tried this, but same results.
https://www.mathworks.com/matlabcentral/answers/418111-how-to-save-spectrogram-of-signal-as-image

댓글을 달려면 로그인하십시오.

 채택된 답변

Rik
Rik 2022년 8월 21일

0 개 추천

You can do the work yourself (as the axes contains a Position property from which you can determine what you need to crop), but the export_fig function from Yair Altman is probably what you need.
It should be able to export a screenshot of only the axes itself.
Otherwise, you could try digging in the properties to see if there is a CData property you could export directly (which would be the raw underlying data).

댓글 수: 6

Sania Gul
Sania Gul 2022년 8월 21일
tnk u sooooooooooooo much. Stay happy :)
Rik
Rik 2022년 8월 21일
You're welcome, glad to be of help.
Sania Gul
Sania Gul 2022년 8월 22일
편집: Sania Gul 2022년 8월 22일
Sorry for disturbing u again, but my axis are not disappearing even by using your recommended function. From command:
export_fig AA.jpg -native -c[31 52 0 0];
I get
i.e. the top and right borders are successfully cropped, but when I set the bottom and left cropping values lower than 20 and 25 nothing happens, but as soon as they are equal to or above 20 and 25 respectively, i.e.
export_fig AA.jpg -native -c[31 52 20 25];
the stored image becomes
But, this is not what I want. I only want to store an image like the one given below:
Please, help me. I am stuck.
Rik
Rik 2022년 8월 22일
Perhaps disabling the tick marks before exporting will already do the trick.
Sania Gul
Sania Gul 2022년 8월 22일
Its done. So So sO many thanks. Infinite thanks. OOOOF I m in the air.
Rik
Rik 2022년 8월 22일
You're welcome, glad you were able to help yourself ;)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

질문:

2022년 8월 21일

댓글:

Rik
2022년 8월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by