MATLAB R2017a UIAxes Pan/Zoom Limits

喜欢而已 提交于 2019-12-11 12:59:09

问题


In our previous code we've had a basic UI using standard figures. I'm in the process of updating the code to use the new app designer style UIFigures - I'm not actually using the app designer tool, but rather building it programmatically.

When using the standard figures and axes, it is possible to constrain zooming and panning of an axis to say just the horizontal (x) direction. This was done using

pan 'xon'; %or
zoom 'xon';

However this style doesn't work for UIAxes elements.

I've tried modifying it to:

pan(theUIAxesElement, 'xon'); %or
zoom(theUIAxesElement, 'xon');

That arrangement works for the standard 'on' and 'off' parameters, however for the 'xon' or 'yon' I simply get an error message:

Error using matlab.ui.control.UIAxes/zoom
Unknown action character vector.

Are there any alternative approaches to accomplish the same behaviour as before - i.e. limiting pan and zoom to just one axis direction?


Note - if you need a minimal example to try out, the easiest thing to do is to run appdesigner, drag on a UIAxes element, and then run it. You should get a NameOfApp.NameOfAxesElement handle.

来源:https://stackoverflow.com/questions/51352856/matlab-r2017a-uiaxes-pan-zoom-limits

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