How to make the axis adjust to new plots
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
In the app designer i have included a plot for projectile motion, however i cant seem to make the axis values adjust when plotting a second graph on top of it- it remains at the limits of the first plot i.e. i cant see the second plot provided the x and y values are greater than the first plot
any help would be greatly appreciated! im pulling my hair out over this!
comet(app.Graph,x,y,0.1)
hold(app.Graph,'on')
4 Commenti
Jan
il 20 Dic 2020
Please post code as text, noit as screenshot. This makes it much easier to use copy&paste to post an answer.
Risposte (2)
Cris LaPierre
il 24 Dic 2020
I would add the following to the bottom of your plotting code.
hold(app.Graph,'off') % best practice to always pair hold on with a hold off
axis(app.Graph,'auto')
0 Commenti
Rishabh Mishra
il 24 Dic 2020
Hi,
Based on my understanding of the issue, I can assume that you are using ‘app.graph’ as axes handle object to create plots over it.
In this case, since the x & y limits of the axes object is not appropriate, you are unable to view the 2nd plot.
To resolve the issue, readjust the x & y limits of the axes handle object ‘app.graph’. The code is given below:
app.graph.XLim = [-20 20]; % example range of values
app.graph.YLim = [-20 20]; % example range
The range of values above should be such that it includes both the plots.
Hope this helps.
0 Commenti
Vedere anche
Categorie
Scopri di più su 2-D and 3-D Plots in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!