Setting graph shape size

All I want to do is make the width bigger and the height smaller. I just do raster graphics, but this question applies to any MATLAB figure . I can manually resize it using the shape directly when it was created, but I want the program to spit it out at the right size to start.

+85
matlab matlab-figure
03 Mar 2018-11-11T00:
source share
5 answers

Can this help you?

 hFig = figure(1); set(hFig, 'Position', [xy width height]) 
+80
Mar 03 '11 at 15:52
source share

Write it as single line :

 figure('position', [0, 0, 200, 500]) % create new figure with specified size 



enter image description here

+58
Aug 18 '14 at 13:15
source share
  figure (1) hFig = figure(1); set(gcf,'PaperPositionMode','auto') set(hFig, 'Position', [0 0 xwidth ywidth]) plot(x,y) print -depsc2 correlation.eps; % for saving in eps, look up options for saving as png or other formats you may need 

Saves shape in specified dimensions

+30
Dec 28
source share

I managed to get a good result with the following sequence (run Matlab twice at the beginning):

 h = gcf; % Current figure handle set(h,'Resize','off'); set(h,'PaperPositionMode','manual'); set(h,'PaperPosition',[0 0 9 6]); set(h,'PaperUnits','centimeters'); set(h,'PaperSize',[9 6]); % IEEE columnwidth = 9cm set(h,'Position',[0 0 9 6]); % xpos, ypos must be set txlabel = text(xpos,ypos,'$$[\mathrm{min}]$$','Interpreter','latex','FontSize',9); % Dump colored encapsulated PostScript print('-depsc2','-loose', 'signals'); 
+1
Feb 17 '16 at 13:06
source share

Another approach.
In the call to figure() specify properties or change the properties of the shape descriptor after h = figure() .

This creates a full-screen drawing based on normalized units.
figure('units','normalized','outerposition',[0 0 1 1])

The units property can be set to inches, centimeters, pixels, etc.

See figure documentation .

0
Oct 31 '18 at 16:29
source share



All Articles