Tuesday, June 16, 2015

Save Only Matlab Colorbar as a figure

Could not find a good solution to save the matlab colorbar. One idea was to duplicate the figure, then crop it out. Then I thought may be turning the axis would do the job. It does!
I was able to save it as a jpeg figure.

The following code was tested in Matlab2015a. Use it at your risk.
figure
colormap('parula');
caxis([0.4 0.9]);hc = colorbar;
axis off; set(gcf,'Color','White')
export_fig([savePaperFig, 'ColorBarTrans', obsname],'-jpeg','-r250')

No comments: