Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: axis size changes when removing tick labels
Replies: 6   Last Post: Jan 22, 2013 4:23 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
matt dash

Posts: 625
Registered: 4/18/08
Re: axis size changes when removing tick labels
Posted: Jan 22, 2013 4:23 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"rachael " <rmueller@coas.oregonstate.edu> wrote in message <kdk4og$qsu$1@newscl01ah.mathworks.com>...
> dpb <none@non.net> wrote in message <kcn2rc$e1m$2@speranza.aioe.org>...
> > On 1/10/2013 10:48 AM, rachael wrote:
> > > I'm going to file a bug report.
> >
> > Please don't toppost--hard conversation follow makes...
> >
> > Have you checked renderer settings, etc., that it may be a fignewton of
> > the particular graphics drivers, hardward display card, etc., etc., ...?
> >
> > --

>
> Okay, Yoda, I won't "toppost" this time. :-)
>
> I suppose I hadn't considered fignewtons in my graphics drivers or hardware. You may be onto something to detect a delectable, yet erroneous, "treat" in my system but the "renderer" alone doesn't appear to do the trick.
>
> Here is the work around that was offered by a Mathworks tech. with whom I troubleshot the issue:
>
> fig = figure;
> set(fig, 'color','w');
> hndl = axes('Position',[0 0 1 1], 'Visible','off','color','w');
> ax = [0,800,1800,3000];
> position = [0.1 0.1 0.3 0.7]; % of axes1.
> xLim = [0,800];
> yLim = [1800,3000];
>
> axes1 = axes(...
> 'OuterPosition', [0.1 0.1 0.3 0.7], ...
> 'Parent', fig, ...
> 'fontsize', 12);
>
> axes2 = axes(...
> 'OuterPosition', [0.5, 0.1 0.3 0.7],...
> 'Parent', fig, ...
> 'fontsize', 12, ...
> 'yticklabel', []);
>
> hold(axes1,'all');
> hold(axes2,'all');
>
> % plot bathymetry
> pcolor(axes1, ws.y, ws.x , ws.h);
> pcolor(axes2, ws.y,ws.x , ws.h);
> shading(axes1, 'flat');
> shading(axes2, 'flat');
>
> axis([axes1, axes2], 'equal');
>
> %% NOTE: setting the 'xlim' and 'ylim' here is what really seems to do the fix. The %% code I had used before was along the lines of "axis([axes1, axes2], ax)", but this %% code (now) produces uneven yaxes. Specifyin the xlim and ylim independently %% seems to be the ticket.
> set(axes1,...
> 'layer' ,'top',...% Draw axes lines above data
> 'position',position,...
> 'xLim' ,xLim,...
> 'yLim' ,yLim);
>
> set(axes2,...
> 'layer' ,'top',...% Draw axes lines above data
> 'position',position + [0.4 0 0 0],...
> 'xLim' ,xLim,...
> 'yLim' ,yLim);


When you use the axis function, it usually sets your axes to an annoying "stretch to fill" mode, which is kind of (but not really) explained here: http://www.mathworks.com/help/matlab/visualize/understanding-axes-aspect-ratio.html

It's related to some rather obscure axes properties that i can never figure out. As suggested by the workaround, when you need your axes to do exactly what you want them to do, it's best to avoid axis() and set the limits directly with the set function.



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.