From: Jeff on
How can I fix the axes so they don't change? I keep setting it, and then every time I add something, it resets. I can't find the answer in the doc set or online.

cells=zeros(dim);
cells(seed(1),seed(2))=64;
image(cells);
axis equal; axis tight;

walkers=zeros(num,2);
walkers(:,1)=randi(dim(1),num,1);
walkers(:,2)=randi(dim(2),num,1);
for ii=1:num
cells(walkers(ii,1),walkers(ii,2))=40;
end
image(cells);
axis equal; axis tight;

See how I have to set the axis every time?
Thanks,
From: Jeff on
"Jeff " <spREMOVEHITSjeffAT(a)SIGNoptonline.net> wrote in message <ho1iqo$s5m$1(a)fred.mathworks.com>...
> How can I fix the axes so they don't change? I keep setting it, and then every time I add something, it resets. I can't find the answer in the doc set or online.
>
> cells=zeros(dim);
> cells(seed(1),seed(2))=64;
> image(cells);
> axis equal; axis tight;
>
> walkers=zeros(num,2);
> walkers(:,1)=randi(dim(1),num,1);
> walkers(:,2)=randi(dim(2),num,1);
> for ii=1:num
> cells(walkers(ii,1),walkers(ii,2))=40;
> end
> image(cells);
> axis equal; axis tight;
>
> See how I have to set the axis every time?
> Thanks,

I can use hold on, but that uses up too much memory.
From: Steven Lord on

"Jeff " <spREMOVEHITSjeffAT(a)SIGNoptonline.net> wrote in message
news:ho1iqo$s5m$1(a)fred.mathworks.com...
> How can I fix the axes so they don't change? I keep setting it, and then
> every time I add something, it resets. I can't find the answer in the doc
> set or online.

Change the XLimMode, YLimMode, and/or ZLimMode properties of your axes.

http://www.mathworks.com/access/helpdesk/help/techdoc/ref/axes_props.html#XLimMode

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ


From: Jeff on
"Steven Lord" <slord(a)mathworks.com> wrote in message <ho1ktf$s5t$1(a)fred.mathworks.com>...
>
> "Jeff " <spREMOVEHITSjeffAT(a)SIGNoptonline.net> wrote in message
> news:ho1iqo$s5m$1(a)fred.mathworks.com...
> > How can I fix the axes so they don't change? I keep setting it, and then
> > every time I add something, it resets. I can't find the answer in the doc
> > set or online.
>
> Change the XLimMode, YLimMode, and/or ZLimMode properties of your axes.
>
> http://www.mathworks.com/access/helpdesk/help/techdoc/ref/axes_props.html#XLimMode
>
> --
> Steve Lord
> slord(a)mathworks.com
> comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
>

I wasn't searching on the right terms.
Thanks.
From: Jeff on
"Jeff " <spREMOVEHITSjeffAT(a)SIGNoptonline.net> wrote in message <ho1v89$r7r$1(a)fred.mathworks.com>...
> "Steven Lord" <slord(a)mathworks.com> wrote in message <ho1ktf$s5t$1(a)fred.mathworks.com>...
> >
> > "Jeff " <spREMOVEHITSjeffAT(a)SIGNoptonline.net> wrote in message
> > news:ho1iqo$s5m$1(a)fred.mathworks.com...
> > > How can I fix the axes so they don't change? I keep setting it, and then
> > > every time I add something, it resets. I can't find the answer in the doc
> > > set or online.
> >
> > Change the XLimMode, YLimMode, and/or ZLimMode properties of your axes.
> >
> > http://www.mathworks.com/access/helpdesk/help/techdoc/ref/axes_props.html#XLimMode
> >
> > --
> > Steve Lord
> > slord(a)mathworks.com
> > comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
> >
>
> I wasn't searching on the right terms.
> Thanks.

Oops, I spoke too soon. Sorry about that.

Setting the LimModes is not stopping the axes from being resized when I issue a new image command. The LimModes only have prevent the axes from being changed if you turn 'hold on'. But I can't do that, since it uses way too much memory and slows down my program to a crawl.

Here's the basics of my program (I'm trying to imitate diffusion limited aggregation):

seed=[randi(dim(1)) randi(dim(2))];
cells=zeros(dim);
cells(seed(1),seed(2))=stable;
image(cells); % Causes the axes to be resized according to the size of 'cells'.
axis equal; axis tight; axis off; axis manual;
drawnow;

-create matrix of 'walker' particles, same size as 'cells'
while stable~=0
-randomly move 'walkers' around their matrix
image(cells+walkers); % This line resizes and reshows the axes again, even though 'axis ma
end

I need this for my homework and it's killing me. OTOH, I'm probably getting an A in this class anyway.

Thanks for any help,