缩放/调整大小/重绘绘图时,Matlab是否执行回调? [英] Does Matlab execute a callback when a plot is zoomed/resized/redrawn?

查看:102
本文介绍了缩放/调整大小/重绘绘图时,Matlab是否执行回调?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Matlab中,当用户放大绘图窗口时,我想更新在一组轴上绘制的数据.例如,假设我要绘制分析定义的特定函数.当用户放大迹线时,我想用其他数据更新绘图窗口,以便他们可以任意分辨率检查函数.

In Matlab, I would like to update the data plotted in a set of axes when the user zooms into the plot window. For example, suppose I want to plot a particular function that is defined analytically. I would like to update the plot window with additional data when the user zooms into the traces, so that they can examine the function with arbitrary resolution.

Matlab是否提供钩子以在视图更改时更新数据? (或者只是何时重绘?)

Does Matlab provide hooks to update the data when the view changes? (Or simply when it is redrawn?)

推荐答案

是的. 缩放模式对象具有以下回调:

Yes, it does. The ZOOM mode object has the following callbacks:

ButtonDownFilter
ActionPreCallback
ActionPostCallback

后两个在缩放功能之前或之后执行.您可以在ActionPostCallback中设置更新功能,在该位置根据新的轴限制更新绘图(轴的句柄作为回调的第二个输入参数传递).

The latter two are executed either just before or just after the zoom function. You could set your update function in ActionPostCallback, where you'd update the plot according to the new axes limits (the handle to the axes is passed as the second input argument to the callback).

这篇关于缩放/调整大小/重绘绘图时,Matlab是否执行回调?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆