Domanda

In , 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.

È stato utile?

Soluzione

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])

To specifically pan only, for example 5 units to the left, you could use:

xlim(aHandle, xlim(pHandle)+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.

If the axis handle aHandle is ommitted, then the result of gca is used.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top