Saving a plot as png 224*224*3 image
Show older comments
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 Comments
KALYAN ACHARJYA
on 17 Feb 2021
Edited: KALYAN ACHARJYA
on 17 Feb 2021
Can you share plot details?
ali
on 18 Feb 2021
Answers (1)
Rik
on 17 Feb 2021
0 votes
You can do three things:
- Don't create your image as a plot, but as an image.
- Crop the image down to the location of your axes object.
- Use export_fig.
14 Comments
ali
on 18 Feb 2021
Rik
on 18 Feb 2021
That depends on how you created this plot. You can probably round your data to integer and use ind2rgb to convert to an RGB image. If you attach example data and your code, we might be able to give an explicit example.
ali
on 20 Feb 2021
Rik
on 20 Feb 2021
Your data is not attached and if hanning is a function, it no longer exists (although there is a hann function).
I don't have the signal processing toolbox, so I will need to expirement with the Run feature in this forum.
ali
on 23 Feb 2021
Rik
on 23 Feb 2021
Can you reduce the size of the variables? Is all data really necessary? The image will look differently, but I should still be able to reproduce a similar image.
ali
on 8 Mar 2021
Rik
on 8 Mar 2021
What code should I be using?
ali
on 22 Mar 2021
Rik
on 24 Mar 2021
Your mat file contains the variable data, which is not even used by the code. How am I supposed to help you like this?
Check that your code doesn't use any variables appart from those in the mat file.
Put your mat file in a separate folder, call clearvars and then run your code. If it doesn't run for you, it will not run for me either.
And please use the S=load('data.mat') syntax. That will show you immediately where variables are coming from. If it isn't followed by AA=S.AA; I don't even have to download your mat file before telling you that you fix your example.
Also, use the formatting tools when posting.
ali
on 16 Jun 2021
Rik
on 16 Jun 2021
Please use the S=load('data.mat') syntax.
ali
on 17 Jun 2021
ali
on 24 Jun 2021
Categories
Find more on Images in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!