How to Resize 2D Plot Box?

6 visualizaciones (últimos 30 días)
David Russell
David Russell el 24 de En. de 2021
Comentada: David Russell el 1 de Feb. de 2021
I have a (2D) quiver plot for which I've set the DataAspectRatio property of the axes. This seems to have set the plot box aspect ratio correspondingly, and I find myself unable to change it, even as I resize the figure window. I have tried setting the PlotBoxAspectRatio prpoerty to something different, but it doesn't actually change to what I set it to, nor is there any visual change in the plot. All that happens is that PlotBoxAspectRatioMode changes to 'manual'.
How do I actually change the plot box aspect ratio? Is some setting possibly forcing it to stay the same?

Respuestas (1)

Deepak Meena
Deepak Meena el 29 de En. de 2021
Hi David,
Since I don't have much detail on your question , I can guess what you would be doing wrong.You might setting the data aspect ratio of another axes. Try this to set the data aspect ratio of current figure :
set(gca,'DataAspectRatio', [1 1 1]);
Hope this anwer your question
Thanks
  2 comentarios
David Russell
David Russell el 1 de Feb. de 2021
Thanks, but no, that was not the problem. In fact, changing the data aspect ratio does change the plot box aspect ratio accordingly. What I'm trying to do is decouple the plot box aspect ratio from the data aspect ratio, so I can set them independently.
David Russell
David Russell el 1 de Feb. de 2021
On closer inspection, I find that I am able to control the plot box aspect ratio independently from the data aspect ratio by just setting the axis limits (e.g. using the axis command). However, I'll leave this question out there, because I'd still like to know if there is a way to change the plot box aspect ratio graphically. Resizing the figure window did not do it, and clicking and dragging with the zoom tool did not do it.

Iniciar sesión para comentar.

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by