|
vedenev wrote:
> set(gca, 'xlim',xlim(gca), 'ylim',ylim(gca)) do nothing because you
> set same limits.
You are mistaken. The original poster's code would have worked.
>> figure(123);t = plot(exp(1:5)); ax = get(t,'Parent');
disp(get(ax,'XLimMode'));set(ax,'XLim',[0 2]);disp(get(ax,'XLimMode'));
auto
manual
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/axes_props.html#XLimMode
XLimMode, YLimMode, ZLimMode
{auto} | manual
MATLAB or user-controlled limits. The axis limits mode determines whether
MATLAB calculates axis limits based on the data plotted (for example, the
XData, YData, or ZData of the axes children) or uses the values explicitly set
with the XLim, YLim, or ZLim property, in which case, the respective limits
mode is set to manual.
The direct mechanism for the original poster would be to
set(gca,'XLimMode','manual','YLimMode','manual')
|