From: Travis Knepp on
"us " <us(a)neurol.unizh.ch> wrote in message <i3rh1o$i58$1(a)fred.mathworks.com>...
> "Travis Knepp" <notpartofaddress.travis.n.knepp(a)nasa.gov.removenotpartofaddress> wrote in message <i3rgd4$86h$1(a)fred.mathworks.com>...
> > I'm plotting data that is date/time stamped. I've separated the data according to day of week (via weekday), and averaged each day's data according to the hour it was recorded (this is a multi-week data set). I only have data between 1000 and 2000 on each day, so when I plot the data with the x-axis spanning from Monday - Sunday, there is a lot of dead space (between 2001 - 0959). Further, where there is data plotted, everything is squished together. Anyone know if I can have my x-axis go from, say Monday 1000-2000, then Tuesday 1000-2000 etc with no space between the 2000 tick for Monday and the 1000 tick for Tuesday?
>
> one of the many solutions
> - a skeleton
>
> x=1:10;
> y=[1,0,0,2,2,2,0,0,3,3];
> ix=y>0;
> xs=x(ix);
> ys=y(ix);
> n=numel(xs);
> stem(1:n,ys);
> set(gca,...
> 'xtick',1:n,...
> 'xticklabel',xs,...
> 'xlim',[0,n+1],...
> 'ylim',[0,max(ys)+1]);
>
> us

Thanks. At first I didn't think this would work...but it worked beautifully. A nice, simple solution.