`imagesc` in MATLAB: paper size and `colorbar` -
i using imagesc
in matlab show nxm
matrix image, warmer color higher value. using following command:
f = imagesc(points, [0 1]);
the matrix points
displayed. nevertheless, legend showing coupling between colors , values missing. have found out command:
colorbar
can used display requested legend. however, when printing figure on pdf using following lines of code:
set(gcf, 'paperunits', 'centimeters') set(gcf,'papersize',[12 8]) % set paper size figure size print('-dpdf',figurepath)
i encounter 2 problems:
- the paper size not set properly
- the color bar not showing on pdf
how can fix these problems?
thanks in advance,
eleanore.
i've found solution in state of art, uses export_fig
script (https://sites.google.com/site/oliverwoodford/software/export_fig).
the following code needed:
set(gcf, 'color', 'w'); % change background color set(gcf, 'position', [100 100 700 500]) % change figure dimensions export_fig([figurepath '.pdf']) % export figure
Comments
Post a Comment