Programmatically invoke pan tool

断了今生、忘了曾经 提交于 2019-12-13 21:18:47

问题


In matlab, how to change plot pan programmatically?

the function syntax from the documentation:

pan on
pan xon
pan yon
pan off
pan
pan(figure_handle,...)
h = pan(figure_handle)

the code seems to be used for enabling and disabling the tool and decide the pan direction vertically or horizontally , How could I change plot with handle pHandle using pan function or whatever programmatically.


回答1:


To change the pan, I generally use the axis limit functions

xlim(aHandle, [xlow xhigh])
ylim(aHandle, [ylow yhigh])
axis(aHandle, [xliw xhigh ylow yhigh])

To specifically pan only, for example 5 units to the left, you could use:

xlim(aHandle, xlim(pHandle)+5);

This last function use the xlim command to read the current x axis limits, adds 5, and then uses the same function to set the x limits to a value that is 5 higher.

If the axis handle aHandle is ommitted, then the result of gca is used.



来源:https://stackoverflow.com/questions/14663412/programmatically-invoke-pan-tool

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!