dpb <firstname.lastname@example.org> wrote in message <email@example.com>... > On 8/28/2013 3:37 PM, Larry Rose wrote: > > dpb <firstname.lastname@example.org> wrote in message <email@example.com>... > >> On 8/28/2013 1:47 PM, Larry Rose wrote: > >> > hello, > >> > Does someone know a command to limit the number of x-axis tick labels? > >> > So, could limit the number of labels to a specific number of labels. I > >> > have too many so I can't even read them unless I enlarge the graph. > >> > please advise. > >> > >> Not specifically a command, no...use the 'xtick' and/or 'xticklabel' > >> properties to set the number/values. > >> > >> To cut them in half, for example, > >> > >> xt=get(gca,'xtick'); % get the current ones > >> xt(1:2:end)=; % wipe out every other one > >> set(gca,'xtick',xt) % and replace w/ updated > >> > >> Innumerable variations upon a theme are possible, of course... > >> > >> -- > >> > > Thanks to both of you guys, yes I see this logic should work , but when > > I actually chart the item is using the middle date for the end date of > > the x axis? > > > > I used your guys command below: > > xt=get(gca,'xtick'); % get the current ones > > xt(1:2:end)=; % wipe out every other one > > set(gca,'xtick',xt) % and replace w/ updated > > > > it does cut down on the amount of tick labels, but it is only charting > > up to the middle tickmark and treating that as the end point. > > not sure why > > > > Works here...show code that doesn't... > > >> xt=get(gca,'xtick') > xt = > 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 > >> xt(2:2:end)= > xt = > 0 0.2 0.4 0.6 0.8 1.0000 > >> set(gca,'xtick',xt) > > I get ticks a the above locations from left to right axis. > > Oh, I notice you mention 'date' -- you haven't done something like > 'keepticks' with datetick() perchance? That likely would screw up the > above ploy... > > --
Hey , yes ok, I had to move one of my commands to below the code you guys gave me.
This had to be moved : dateaxis('x',2)
Funny thing is since moving this command lower the original issue I had went away and now the dates fit on the screen. This is great. Thanks.