Prev: Can i run my simulink model from my GUI
Next: Area integral over a triangle in MATLAB -- is numerical integration possible?
From: Rune Allnor on 20 Mar 2010 13:07 On 20 Mar, 17:46, "Jeff " <spREMOVEHITSjef...(a)SIGNoptonline.net> wrote: > "Jeff " <spREMOVEHITSjef...(a)SIGNoptonline.net> wrote in message <ho1v89$r7...(a)fred.mathworks.com>... > > "Steven Lord" <sl...(a)mathworks.com> wrote in message <ho1ktf$s5...(a)fred..mathworks.com>... > > > > "Jeff " <spREMOVEHITSjef...(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..... > > > > -- > > > Steve Lord > > > sl...(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 doc axes After the first call to IMAGE, save the current axes settings as ax = axes; After the subsequent calls, use axes(ax) Rune
From: Jeff on 20 Mar 2010 13:44 Rune Allnor <allnor(a)tele.ntnu.no> wrote in message <6754e674-5e0b-4c25-ac1f-eac1315a1c39(a)33g2000yqj.googlegroups.com>... > On 20 Mar, 17:46, "Jeff " <spREMOVEHITSjef...(a)SIGNoptonline.net> > wrote: > > doc axes > > After the first call to IMAGE, save the current > axes settings as > > ax = axes; > > After the subsequent calls, use > > axes(ax) > > Rune Thanks, Rune. That works. But I still have to reset the axes, using the axes(ax) command. I'm trying to get them to stay fixed, so they don't have to be reset at all (and without using 'hold on').
From: Rune Allnor on 20 Mar 2010 14:01 On 20 Mar, 18:44, "Jeff " <spREMOVEHITSjef...(a)SIGNoptonline.net> wrote: > Rune Allnor <all...(a)tele.ntnu.no> wrote in message <6754e674-5e0b-4c25-ac1f-eac1315a1...(a)33g2000yqj.googlegroups.com>... > > On 20 Mar, 17:46, "Jeff " <spREMOVEHITSjef...(a)SIGNoptonline.net> > > wrote: > > > doc axes > > > After the first call to IMAGE, save the current > > axes settings as > > > ax = axes; > > > After the subsequent calls, use > > > axes(ax) > > > Rune > > Thanks, Rune. > That works. But I still have to reset the axes, using the axes(ax) command. I'm trying to get them to stay fixed, so they don't have to be reset at all (and without using 'hold on'). No, you don't. The only way to have axes *stay* *fixed* is to use the HOLD ON command. Because in that case you plot a sequence of figures in the same axis object. Without the HOLD ON command, what happens is that every time you plot a new image, you - Delete the existing image, if any - Draw the new image - Matlab automatically computes whatever axis settings it thinks appropriate, given the plot If you want something else then what matlab automatically does, it is *your* responsibility to adjust the settings. Rune
From: Jeff on 20 Mar 2010 14:38 Rune Allnor <allnor(a)tele.ntnu.no> wrote in message <df0fd14c-ee60-40ae-a196-3f64fd03a226(a)t23g2000yqt.googlegroups.com>... > On 20 Mar, 18:44, "Jeff " <spREMOVEHITSjef...(a)SIGNoptonline.net> > wrote: > > Rune Allnor <all...(a)tele.ntnu.no> wrote in message <6754e674-5e0b-4c25-ac1f-eac1315a1...(a)33g2000yqj.googlegroups.com>... > > > On 20 Mar, 17:46, "Jeff " <spREMOVEHITSjef...(a)SIGNoptonline.net> > > > wrote: > > > > > doc axes > > > > > After the first call to IMAGE, save the current > > > axes settings as > > > > > ax = axes; > > > > > After the subsequent calls, use > > > > > axes(ax) > > > > > Rune > > > > Thanks, Rune. > > That works. But I still have to reset the axes, using the axes(ax) command. I'm trying to get them to stay fixed, so they don't have to be reset at all (and without using 'hold on'). > > No, you don't. The only way to have axes *stay* *fixed* is > to use the HOLD ON command. Because in that case you plot > a sequence of figures in the same axis object. > > Without the HOLD ON command, what happens is that every time > you plot a new image, you > > - Delete the existing image, if any > - Draw the new image > - Matlab automatically computes whatever axis settings > it thinks appropriate, given the plot > > If you want something else then what matlab automatically > does, it is *your* responsibility to adjust the settings. > > Rune Oh. I see now. In that case, I guess I have to use the HOLD ON command and then instead of plotting the entire image again, I have to set and reset individual points. Thanks for the explanation.
From: Rune Allnor on 20 Mar 2010 14:48
On 20 Mar, 19:38, "Jeff " <spREMOVEHITSjef...(a)SIGNoptonline.net> wrote: > Rune Allnor <all...(a)tele.ntnu.no> wrote in message <df0fd14c-ee60-40ae-a196-3f64fd03a...(a)t23g2000yqt.googlegroups.com>... > > On 20 Mar, 18:44, "Jeff " <spREMOVEHITSjef...(a)SIGNoptonline.net> > > wrote: > > > Rune Allnor <all...(a)tele.ntnu.no> wrote in message <6754e674-5e0b-4c25-ac1f-eac1315a1...(a)33g2000yqj.googlegroups.com>... > > > > On 20 Mar, 17:46, "Jeff " <spREMOVEHITSjef...(a)SIGNoptonline.net> > > > > wrote: > > > > > doc axes > > > > > After the first call to IMAGE, save the current > > > > axes settings as > > > > > ax = axes; > > > > > After the subsequent calls, use > > > > > axes(ax) > > > > > Rune > > > > Thanks, Rune. > > > That works. But I still have to reset the axes, using the axes(ax) command. I'm trying to get them to stay fixed, so they don't have to be reset at all (and without using 'hold on'). > > > No, you don't. The only way to have axes *stay* *fixed* is > > to use the HOLD ON command. Because in that case you plot > > a sequence of figures in the same axis object. > > > Without the HOLD ON command, what happens is that every time > > you plot a new image, you > > > - Delete the existing image, if any > > - Draw the new image > > - Matlab automatically computes whatever axis settings > > it thinks appropriate, given the plot > > > If you want something else then what matlab automatically > > does, it is *your* responsibility to adjust the settings. > > > Rune > > Oh. I see now. > In that case, I guess I have to use the HOLD ON command and then instead of plotting the entire image again, I have to set and reset individual points. Again - no. You already figured out why that's a bad idea: It takes a lot of memory. Don't quibble over semantics, but use the method that works most efficiently: And axes command like I showed you in th eloop you already have. Rune |