save image without the white border
69 views (last 30 days)
Show older comments
Hello. I would like to save a phot, or any imagesc, pcolor or whatever 2D image. But the problem is that matlab alway automatically leaves a white border somehow. I would like to remove it because I have thousands of photos to process and I cannot crop them manually. I don't quite understand why this is automatically left and there is simply no option in print or saveas to remove the white border.
For example, to generate a random 2D matrix
h = figure(1)
x = rand(50,50);
imagesc(x)
xticks([]);yticks([])
print(['-dpng'],'Fig')
I always get a white border in the end. Could someone give a suggestion on how to remove it. Please, if you want to recommend export_fig, please give an example. This package seems to have no examples in the help. Thanks!
0 Comments
Answers (2)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!