Using zoom with rectangle cuts of area

9 visualizaciones (últimos 30 días)
Rolf
Rolf el 13 de Nov. de 2023
Editada: Matt J el 13 de Nov. de 2023
In an application, I am using the zoom function to enable zooming by user interaction.
Sometimes when using the rectangular click & drag region I run into the problem, that the zoomed imag cuts off parts of the box's content. When the ratio of the box and the axes are not the same it makes sense that the zoomed imaged cannot contain exactly the selected region. But I would prefered it in that case that the zoomed image would add some padding around the selection to fit into the axes instead of cutting parts away. In other words, the zoomed image should always contain AT LEAST the selected region, if necessary it can show more but never less.
The behaviour occures in R2022b, in an older version of the same application running in R2015b I never had the problem. Is there any way to make the zoom box to behave as I want it to?

Respuestas (1)

Matt J
Matt J el 13 de Nov. de 2023
Editada: Matt J el 13 de Nov. de 2023
Don't use zoom. Use XLim and YLim to control the viewable region. That will let you set its boundaries exactly as you like them.

Categorías

Más información sobre Data Exploration en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by