Hi,
I try to plot a function and to mark some locations using rectangle. I use
pan xon
to be able to pan, and the y axes rescale automatically (if I don't put the rectangles). How can I tell Matlab to disregard the rectangles when rescalling. I want the rectangles to mark vertical strips along the whole ylim domain (which adjusts as I pan). If this is not possible are there other elements (e.g. line or something else) which don't rescale the axis limits?
Thanks,
Razvan
EDIT: Here is an example:
x = 1:1000;figureax(1) = subplot(211);% hold on
% for pos = 100:100:1000
% rectangle('Position', [pos -1000 5 2000], 'FaceColor',[0.5 1 0.5])
% end
plot(x .* sin(x));xlim([51 100])ax(2) = subplot(212);plot(sin(x));xlim([51 100])linkaxes(ax, 'x');pan xon
If the rectangles are not plotted, then I can pan the lower panel and the y axis of the top panel rescales automatically. (By the way if I pan the top panel the y limit adjustments don't work anymore…)
I want to obtain the same effect but with the marked regions visible. Please uncomment the rectangle part and see that now the y axis has the limits fixed by the rectangle dimensions. I want this to rescale according to the function alone (disregarding the rectangles). Is this possible?
Best Answer