Setting axis tick labels - problems with repeated plots

I am using XTick and XTickLabel to set the labels of the x axis in a plot. It works as expected, but if I then make another plot, the labels from the previous plot are included in the new one, even though I have used "clear all" before the second plot. Why could this be happening? If I close and re-open matlab, I have just the ticks and labels I want for the new plot, but this is definitely too time consuming to do every time.

3 commentaires

have you tried the below commands before plotting a new one.
clear axes
cla reset
lvn
lvn le 19 Mar 2014
also make a new figure ("figure") or close your figure ("close all") before making a new one
Probably ensure that
hold off
is in effect before starting the new plot is all that's required I guess...altho if the new plot is indeed totally independent of the previous then
close(gcf)
figure
is the logical sequence, indeed.

Connectez-vous pour commenter.

Réponses (0)

Question posée :

le 19 Mar 2014

Commenté :

dpb
le 19 Mar 2014

Community Treasure Hunt

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

Start Hunting!

Translated by