Search code examples
imagematlabfigure

How do I save just figure image without any graduation and numbers on x, y axis?


I used matlab code.

img = imread('cmap3.png')
map = jet(256)
ind = rgb2ind(img,map)

colormap(map)
cm = colormap('gray)
image(ind)

Through above code, I got the figure.

I want to save just the gray scale image without any graduations and numbers on x,y axis. How do I remove them and save gray scale image?


Solution

  • If you use imwrite, you won't save the axes' labels.

    For actual plots, there exists a different solutions, eg. described here: set the axis to start at the very left bottom corner so that there is no space left for descriptions: set(gca, 'Position',[0 0 1 1]). Than you can even use print to save the image/figure.