Showing posts with label matlab subplots. Show all posts
Showing posts with label matlab subplots. Show all posts

Wednesday, July 30, 2008

advanced way to export figures using hgexport with matlab

i will explain how to export figures to a file using hgexport with matlab.
here is how:
first you need to create the figure:


h.figure = figure
clf
position = get(gcf,'Position');
set(h.figure,'Color','w',...
'PaperPositionMode', 'auto', ...
'Units','in','Position',[position(1:2) 6 2.5 ],...
'PaperPosition',[0.25 0.25 6 2.5])

then, plot the figure. use all the commands you like, like plot, stairs and subplot...
at the end, export the figure using hgexport:

myStyle = hgexport('factorystyle');
myStyle.Format = 'png';
myStyle.Width = 6;
myStyle.Height = 2.5;
myStyle.Resolution = 300;
myStyle.Units = 'inch';
myStyle.FixedFontSize = 12;
hgexport(h.figure,'fileout.png',myStyle,'Format','png')

with Width and Height you can control the size of the file in inch (units).

Thursday, March 6, 2008

advanced subplots in matlab

Hi People, there is a new interesting video blog etnry at matlab. It talks about advanced technics to make subplots.

you can find the video here: