Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Axis disappear when setting XLim,YLim

36 views
Skip to first unread message

Stefan

unread,
May 18, 2009, 1:26:02 PM5/18/09
to
Hey...

Sometimes the X or Y axis disappears when setting XLim & YLim !
But only the horizontal or vertical line, the ticks and labels are still visible...
Anyone knows why?

Thanks

Wayne King

unread,
May 18, 2009, 1:35:02 PM5/18/09
to

Hi Stefan, can you give a concrete example with some code? That will help people to solve your problem more easily.

wayne
"Stefan" <s...@m.de> wrote in message <gus5na$dsr$1...@fred.mathworks.com>...

Stefan

unread,
May 28, 2009, 6:19:02 AM5/28/09
to
Well it's really hard to reproduce that error, but here's the code that I use for my GUI!
Unfortunally, if I run this code seperate, everything is fine... If I run this in my GUI, then the X-axis disappears (strangely)
If I set the lower YTick ( xy{2}(1) ) to 2*10^8 then the axis reappears, so there could be a problem with setting the XLim and YLim to certain values:

f=figure('Units','normalized','DockControls','off','Name','name',...
'IntegerHandle','off','MenuBar','none','NumberTitle','off',...
'Position',[.05 .05 .65 .9],'HandleVisibility','callback',...
'Visible','on','Resize','off','Color',[.9255 .9137 .8471],...
'WindowStyle','normal');
p=uipanel('Parent',f,'Position',[.35 .55 .6 .4],'BackgroundColor','white');
a=axes('Parent',p,'OuterPosition',[0 0 1 1],'NextPlot','add',...
'TickDir','out','XLimMode','manual','YLimMode','manual');
X=[0;29.44;176.12;236.99;70.00;29.46;107.59;62.20;128.10;361.76;...
499.06;521.33;683.15;855.79;1068.42;1127.46;1300.15;1507.27;1411.25;...
1364.743;1479.39;1283.82;1157.09;1192.02;1133.50;1147.19;858.46;...
957.26;1143.40;1187.73;872.55;];
Y=[3.730;4.644;2.160;4.120;5.142;4.562;4.140;3.745;3.388;3.935;3.979;...
3.068;4.689;3.178;5.072;4.004;5.337;5.170;5.163;3.466;3.749;5.389;...
2.746;5.506;3.504;4.350;4.879;4.690;5.563;4.597;4.841;]*10^8;
h=plot(a,X,Y,'Color','blue','LineStyle','-','Marker','*');
xy{1}=[fix(min(X)) ceil(max(X))];
xy{2}=[fix(min(Y)) ceil(max(Y))];
set(a,{'xlim','ylim'},xy,'YDir','normal');

Stefan

unread,
May 28, 2009, 10:54:02 AM5/28/09
to
It's even worse on a different computer, if I test my GUI there axis don't appear in almost all cases!
Could that be a graphics problem?
0 new messages