Effacer les filtres
Effacer les filtres

Axes changes while plotting during a for loop

8 vues (au cours des 30 derniers jours)
Isaac Valdez
Isaac Valdez le 16 Juin 2020
I am using a for loop to plot multiple sets of data onto the same graph. I am runnning into the issue of when I run the "for loop", the figure is only capturing part of the data and not the entirity. If someone could explain why this is I would be greatful. Below is the code I am using and the picture that appears.
for i=1:NumBuildPlates
wblplot(B{i});
hold on
end
This is what appears but what I really want is the picture below without having to manually set the axes after it appears.
The picture below is what I want the loop to produce.
  1 commentaire
Kevin Joshi
Kevin Joshi le 17 Juin 2020
Use xlim to increase the lmits.
Since i dont have that data for your plot, my guess is that- the axis is showing limits as per the last plot in the for loop.

Connectez-vous pour commenter.

Réponses (1)

Rahul Narendra Shanbhag
Rahul Narendra Shanbhag le 18 Juin 2020
Modifié(e) : Rahul Narendra Shanbhag le 18 Juin 2020
As far as I’ve understood, your issue seems to be the fact that certain parts of your plot are not showing up by default.
This can happen when the user does not set the axis limits while plotting the multiple data elements onto a single plot, since the axis limits would follow the last known plot setting. Please refer to this documentation on using the xlim function to set the limits. You can alternatively also use the axis function to set the x-axis limits, as well as change other aspects of the plot.
Hope this resolves your issue.

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