Saving a plot as png 224*224*3 image

5 次查看(过去 30 天)
ali
ali 2021-2-17
评论: ali 2021-6-24
Hi,
I have generated a plot in Matlab as shown in figure.When i save it using 'saveas(gcf,'im1.png')' , it is saved as a 656*875*3 png image.I want to save it as 224*224*3 png image without the axis titles,labelling and colorbar.i.e.only the actual plot.Can anyone kindly guide on it?
guide about
Thanks
  2 个评论
ali
ali 2021-2-18
Its a spectrogram with frequency on y axis and time on x axis

请先登录,再进行评论。

回答(1 个)

Rik
Rik 2021-2-17
You can do three things:
  1. Don't create your image as a plot, but as an image.
  2. Crop the image down to the location of your axes object.
  3. Use export_fig.
  14 个评论
ali
ali 2021-6-17
S=load('data.mat');
x = sum(S.data/max(max(abs(S.data)))); %normalizing bw 0 and 1 and summing across rows
figure();
c=jet(256);colormap(c);
spectrogram(x,hanning(512),487,1024,12.4e3,'centered','yaxis','MinThreshold',-50);
ali
ali 2021-6-24
Hi @Rik,
Waiting for your response.
thanks

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Images 的更多信息

产品


版本

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by