From: Sourav Chatterjee on
"Husam Aldahiyat" <numandina(a)gmail.com> wrote in message <hn60d8$nsk$1(a)fred.mathworks.com>...
> "John Baldauf" <eaglecat(a)gmail.com> wrote in message <hn5s6q$eqa$1(a)fred.mathworks.com>...
> > Jan, could you provide more assistance?
> >
> > I have the same issue and came to mathworks central to try to get an answer. I have the same issue. I am quite frustrated. I went thru the help file and read up on Axes Properties. I want to shrink the excessively large horizontal margin, however, I cannot seem to figure out how. The TightInset property is locked. I am making subplots, so I am unsure if that has an affect. What do you suggest?
> >
> > "Jan Simon" <matlab.THIS_YEAR(a)nMINUSsimon.de> wrote in message <hgncgl$88s$1(a)fred.mathworks.com>...
> > > Dear rudjoks!
> > >
> > > > If I type 'AXES' command in MATLAB & the axes shows in the middle of
> > > > figure between grey spaces. what should I do to stretch the axes so
> > > > the axes will cover the grey spaces in figure?? if u don't mind, could
> > > > you also give example codes to solve this problem. Please reply me if
> > > > u know the answer.
> > >
> > > You could read the help files for the properties of the AXES object.
> > > There you find the properties 'Units' and 'Position'.
> > > One way:
> > > axes('Units', 'normalized', 'Position', [0,0,1,1]);
> > > But you can get the figure size in pixels also and use these as position for the axes.
> > >
> > > Good luck, Jan
> > >
> > > PS. To inspect the other properties of the AXES object:
> > > a = axes
> > > get(a) % Show current values
> > > set(a) % Show the default values
>
> set(gca,'position',[x,y,w,l])
>
> x is the distance the axes starts from in the x direction, relative to the figure's left edge. y is the same but in the y direction. w and l and width and length of the axes.
> All values are between 0 and 1, thus
>
> >> set(gca,'position',[0,0,1,1])
>
> Fills the entire figure screen.


Thats probably not going to work, since the 'Position' property indicates only the limits of the plot. It does not include the axes labels. Hence, by making the 'position' property 0 0 1 1 causes the axes labels to be excluded. You have to make the sum of the 'Position' and 'TightInset' equal to the 'OuterPosition' property.

Here's a one line pice of code that does it.

set(gca, 'Position', get(gca, 'OuterPosition') - &#8230;
get(gca, 'TightInset') * [-1 0 1 0; 0 -1 0 1; 0 0 1 0; 0 0 0 1]);

(I don't remember the source but got it from somewhere on the web )
 | 
Pages: 1
Prev: Simhydraulics (
Next: simulink / variables