以编程方式调用平移工具 [英] Programmatically invoke pan tool

查看:101
本文介绍了以编程方式调用平移工具的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

的问题中,如何更改绘图平移以编程方式?

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屋!

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