以编程方式调用平移工具 [英] Programmatically invoke pan tool
问题描述
在 matlab 的问题中,如何更改绘图平移以编程方式?
In matlab, how to change plot pan programmatically?
文档中的函数语法:
pan on
pan xon
pan yon
pan off
pan
pan(figure_handle,...)
h = pan(figure_handle)
该代码似乎用于启用和禁用该工具,并确定垂直或水平的平移方向,如何使用pan
函数或以编程方式进行的任何操作.
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.
推荐答案
要更改平移,通常使用轴限制功能
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])
要专门平移,例如向左平移5个单位,可以使用:
To specifically pan only, for example 5 units to the left, you could use:
xlim(aHandle, xlim(pHandle)+5);
最后一个功能使用xlim
命令读取当前的x轴限制,将其加5,然后使用相同的功能将x限制设置为高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.
如果省略了轴手柄aHandle
,则使用gca
的结果.
If the axis handle aHandle
is ommitted, then the result of gca
is used.
这篇关于以编程方式调用平移工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!