In matlab, how to change plot pan programmatically?
the function syntax from the documentation:
pan on
pan xon
pan yon
pan off
pan
pan(figure_handle,...)
h = pan(figure_handle)
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
To specifically pan only, for example 5 units to the left, you could use:
This last function use the
xlimcommand 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.If the axis handle
aHandleis ommitted, then the result ofgcais used.