Saving a plot as png 224*224*3 image
Mostrar comentarios más antiguos
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 comentarios
KALYAN ACHARJYA
el 17 de Feb. de 2021
Editada: KALYAN ACHARJYA
el 17 de Feb. de 2021
Can you share plot details?
ali
el 18 de Feb. de 2021
Respuestas (1)
Rik
el 17 de Feb. de 2021
0 votos
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 comentarios
ali
el 18 de Feb. de 2021
Rik
el 18 de Feb. de 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
el 20 de Feb. de 2021
Rik
el 20 de Feb. de 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
el 23 de Feb. de 2021
Rik
el 23 de Feb. de 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
el 8 de Mzo. de 2021
Rik
el 8 de Mzo. de 2021
What code should I be using?
ali
el 22 de Mzo. de 2021
Rik
el 24 de Mzo. de 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
el 16 de Jun. de 2021
Rik
el 16 de Jun. de 2021
Please use the S=load('data.mat') syntax.
ali
el 17 de Jun. de 2021
ali
el 24 de Jun. de 2021
Categorías
Más información sobre Images en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!