Saving a plot as png 224*224*3 image

4 visualizzazioni (ultimi 30 giorni)
ali
ali il 17 Feb 2021
Commentato: ali il 24 Giu 2021
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 Commenti
KALYAN ACHARJYA
KALYAN ACHARJYA il 17 Feb 2021
Modificato: KALYAN ACHARJYA il 17 Feb 2021
Can you share plot details?
ali
ali il 18 Feb 2021
Its a spectrogram with frequency on y axis and time on x axis

Accedi per commentare.

Risposte (1)

Rik
Rik il 17 Feb 2021
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 Commenti
ali
ali il 17 Giu 2021
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 il 24 Giu 2021
Hi @Rik,
Waiting for your response.
thanks

Accedi per commentare.

Categorie

Scopri di più su Image Processing Toolbox in Help Center e File Exchange

Prodotti


Release

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by