Using zoom with rectangle cuts of area

9 次查看(过去 30 天)
Rolf
Rolf 2023-11-13
编辑: Matt J 2023-11-13
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?

回答(1 个)

Matt J
Matt J 2023-11-13
编辑:Matt J 2023-11-13
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.

类别

Help CenterFile Exchange 中查找有关 Data Exploration 的更多信息

产品


版本

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by