Matlab Issue with saving figure to an image file -


i plotting equations figures in matlab , trying save figure screws saved image.

this how image displayed matlab figure: enter image description here

however, when try save image gets screwed , comes out this: enter image description here

is there way me save properly?

i have tried following commands , none of them work.

print(gcf,'-dbmp', 'eqn') saveas(gcf,'eqn.bmp') 

i appreciate help!

thanks!

to faithful reproduction of see on screen, have use getframe , frame2im commands follows,

f = getframe(gcf); [im,map] = frame2im(f); if isempty(map)     imwrite(im,'figure.bmp'); else     imwrite(im,map,'figure.bmp'); end 

if use saveas or print, file different dimensions , objects scaled differently, cause equations drawn incorrectly. operation of getframe ensures file resolution reflects have on screen. documentation:

resolution of captured frames

the resolution of framed image depends on size of axes in pixels when getframe called. getframe command takes snapshot of screen, if axes small in size (e.g.,because have restricted view window within axes), getframe captures fewer screen pixels, ...

this means there no redrawing @ different scale (what messes equation).


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -