Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

changing x-tick labels when zooming

55 views
Skip to first unread message

Francis

unread,
Oct 13, 2009, 7:54:39 AM10/13/09
to
I need to create graphs where the x-tick labels are not linear. I can
change them by using ahdl.x_ticks = tlist
(["ticks","locations","labels"],[xtickloc],[xticklab]); normally I
simply divide the range in 51 xtick-location and establish the
corresponding xtick label from a large vector equal to the size of the
plotted data. However since values are fixed, after zooming using the
zoom button in the range is not longer divided in 50 sections.
Does anybody know how to one can update the xtick location and xtick
labels automatically after zooming in using the zoom button.

Red

unread,
Nov 30, 2009, 4:26:12 AM11/30/09
to
Hello Francis,

After zooming you should retreive the bounding box of your plot and
redraw the ticks.
a = gca();
a.data_bounds; % Array of the bounding rectangle coordinates.

% Xmin : a.data_bounds(1)
% Xmax : a.data_bounds(2)
% Ymin : a.data_bounds(3)
% Ymax : a.data_bounds(4)

I hope this helps :-) even if it's a late response,
Red.


On Oct 13, 12:54 pm, Francis <f.drossa...@googlemail.com> wrote:
> I need to create graphs where the x-tick labels are not linear. I can
> change them by using ahdl.x_ticks = tlist
> (["ticks","locations","labels"],[xtickloc],[xticklab]); normally I
> simply divide the range in 51 xtick-location and establish the
> corresponding xtick label from a large vector equal to the size of the

> plotted data. However since values are fixed, after zooming using thezoombutton  in the range is not longer divided in 50 sections.

0 new messages