Save current figure without axis, axis label and other border areas.
27 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
ac_bm_mat
el 3 de Mayo de 2022
How to save current figure without axis, axis label and other white margin spaces around the figure. I don't have direct access to the matrix which is being plotted. So I want to use something like this:
saveas(gcf, "xyz.png");
but additional spaces and axis labels are also coming into it. I want these to be removed. I want to save only the actual plot area.
0 comentarios
Respuesta aceptada
Matt J
el 3 de Mayo de 2022
Editada: Matt J
el 3 de Mayo de 2022
I don't have direct access to the matrix which is being plotted.
Yes, you do. The axes children will always contain the data that is being plotted. So, the easiest would be to replot the figure with,
axis off
export_graphics(gcf, "xyz.png")
A less graceful alternative would be to use export_fig, downloadable from,
which let's you specify the amount of cropping of the exported image. Choose the cropping just right and you will clip away the axis markings.
3 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Annotations en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!