Help with plot axis
13 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Sinead Mc Kinney
el 7 de Mzo. de 2017
Comentada: Star Strider
el 7 de Mzo. de 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 comentarios
Respuesta aceptada
Star Strider
el 7 de Mzo. de 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 comentarios
Star Strider
el 7 de Mzo. de 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.
Más respuestas (0)
Ver también
Categorías
Más información sobre Annotations en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!