determine axis limits *before* plotting..?
조회 수: 33(최근 30일)
I need to determine the y-axis limits "before" rendering my plot, b/c the elements are rendered in a loop, one at a time. xlim() isn't any use in this case. Will I have to reverse-engineer MATLAB's algorithm, or is there another approach?
Image Analyst 2012년 9월 9일
You can save the y and x limits for the current axes at any time by using the ylim and xlim functions:
% Save initial limits.
initial_ylim_values = ylim();
initial_xlim_values = xlim();
% Now plot something that will change the ylimits
plot(x, y); % Some y that will change the y limits.
after_ylim_values = ylim();
after_xlim_values = xlim();