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

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -