plotting a figure with specific x axis

11 vues (au cours des 30 derniers jours)
AA
AA le 12 Oct 2017
Commenté : Walter Roberson le 12 Oct 2017
I have already opened a figure and i want to plot a new figure without being in the old one. For that purpose I want to display the x axis as matrix(:,1) and the y axis as matrix(:4). At the same time I want a vertical dotted line in the new figure when the x axis is a multiple of 60 (60, 120, 180 ....). How will I plot that chart?

Réponse acceptée

AA
AA le 12 Oct 2017
it doesnt work, it draws something in another figure which is already opened. i need it to be drawn into a new figure
  1 commentaire
Walter Roberson
Walter Roberson le 12 Oct 2017
Put the call
figure()
before the plot(x,y) call

Connectez-vous pour commenter.

Plus de réponses (1)

Walter Roberson
Walter Roberson le 12 Oct 2017
x = matrix(:,1);
y = matrix(:,4);
plot(x, y);
maxx = max(x);
maxx = 60 * ceil(maxx/60);
xticks = 0 : maxx;
set(gca, 'xtick', xticks, 'xgrid', 'on', 'gridlinestyle', ':')

Catégories

En savoir plus sur Line Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by