问题
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