Help with plot axis
13 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Sinead Mc Kinney
il 7 Mar 2017
Commentato: Star Strider
il 7 Mar 2017
I have a piece of code that goes through a loop 1000 times determining the values of x and y. I then plot these coordinates.
I want the x and y axis to be the same so I tried axis equal however I obtained a graph with the axises as so. Can anyone explain why the x and y axis aren't equal? The x axis ranges from -300 to 300 and the y axis from 0 to 450.
0 Commenti
Risposta accettata
Star Strider
il 7 Mar 2017
The axis equal call uses the same length for the data units along each axis. It does not affect the range of values. If you want to change those, use the axis call as:
axis([xmin xmax ymin ymax])
You can also combine that call with an axis equal call, so one does not cancel or override the other.
2 Commenti
Star Strider
il 7 Mar 2017
My pleasure.
‘I would like the x axis to range from 0 to 450 as the y axis does.’
Use the ‘ymin’ and ‘ymax’ values for both in your axis call:
axis([ymin ymax ymin ymax])
That should do what you want.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Annotations 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!