Effacer les filtres
Effacer les filtres

How to label different figures with same x and y labels in one command?

15 vues (au cours des 30 derniers jours)
Mary292
Mary292 le 14 Jan 2015
Commenté : Image Analyst le 7 Mar 2015
If I have a few separate figures, all with the same x and y axis labels, is there some way to write the labels just once in my code and for it to apply to all of my figures?
My figures are all listed one after the other if that helps?
E.g.
figure(1)
plot(data_X(:,1:10))
figure(2)
plot(data_Y(:,11:20))
figure(3)
plot(data_Z(:,21:30))
  1 commentaire
Image Analyst
Image Analyst le 7 Mar 2015
Original question, for when Mary overwrites it with gibberish like most of here other questions:
If I have a few separate figures, all with the same x and y axis labels, is there some way to write the labels just once in my code and for it to apply to all of my figures?
My figures are all listed one after the other if that helps?
E.g.
figure(1)
plot(data_X(:,1:10))
figure(2)
plot(data_Y(:,11:20))
figure(3)
plot(data_Z(:,21:30))

Connectez-vous pour commenter.

Réponse acceptée

Rick Rosson
Rick Rosson le 15 Jan 2015
Create a function as for example:
function plotMyData(A)
figure;
plot(A);
xlabel('The X Axis');
ylabel('The Y Axis');
end
Then call your function three times:
plotMyData(data_X(:,1:10));
plotMyData(data_Y(:,11:20));
plotMyData(data_Z(:,21:30));

Plus de réponses (0)

Catégories

En savoir plus sur Interactive Control and Callbacks 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