Overlapping Datetick Xlabels when performing multiple plots

1 view (last 30 days)
I'm making a GUI that allows the user to select data to plot with an initially specified time interval. Multiple set of data can be selected and plotted with the help of the hold command, but now the only problem is the datetick xlabels...
It appears that everytime a plot is added to the axes the newly plotted datetick labels are placed in the correct location, while the previous set are moved up or down corresponding to how the previous data set appears after the new plot is added.
What I need is some kind of command to turn off/delete/make invisible the previously plotted datetick labels before the next plot is made.
Here's my code for the plots
hold (handles.axes1,'on')
plot(handles.axes1,XL,YL,'Color',handles.color(handles.PlotCount,:))
hold (handles.axes1,'off')
XData=linspace(handles.start,handles.end,15);
set(handles.axes1,'XTick',XData);
datetick('x',23,'keepticks');
rotateticklabel(handles.axes1,90);
xlim(handles.axes1,[handles.start handles.end]);
legend('-DynamicLegend')
I've tried different thing with the set command and nothing seems to be working...any help will be appreciated

Answers (0)

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!