2

Is there any workaround to add pan and zoom functionality in uiaxes in matlab appdesigner? appdesigner was introduced in matlab r2016a and officially it doesn't support these options.

Atif Ali
  • 384
  • 4
  • 17
  • Where are you seeing that it doesn't officially support panning and zooming? Adding [`pan`](https://www.mathworks.com/help/matlab/ref/pan.html) and [`zoom`](https://www.mathworks.com/help/matlab/ref/zoom.html) to a callback functions as expected. – sco1 Apr 04 '18 at 19:52
  • In matlab documentation. – Atif Ali Apr 05 '18 at 16:52
  • Update to R2017a or newer. Or programmatically add an [`axes`](https://www.mathworks.com/help/matlab/ref/axes.html) object. – sco1 Apr 06 '18 at 15:49
  • I think we can not add an axes object programmatically in appdesigner. – Atif Ali Apr 14 '18 at 10:00
  • Also i am only interested in adding these features in 2016a. Upgrading isn't an option for me. – Atif Ali Oct 13 '18 at 04:27

2 Answers2

5

For Zooming: zoom(app.UIAxes1,'on');

For Pan: pan(app.UIAxes1,'on');

Obviously your UIAxes name may not be app.UIAxes1.

L. Z.
  • 92
  • 1
  • 8
1

Good news. The toolbars are now supported in 2019a. An example can be found below:

[tb,btns] = axtoolbar(app.UIAxes,{'zoomin','zoomout','restoreview'});

Example run in Matlab 2019a

shehperd
  • 59
  • 4