Prev: Plotting 1 contour with Google Earth Toolbox ge_contourf
Next: Help for interpolation data from 2d to 3d
From: Jeff on 21 Sep 2009 18:44 Hi - I am calling the plot function from within a while loop, which produces about 30 separate plots. However, each succeeding plot moves the x-axis closer to the right, to the point where the xticks and labels are all crammed in on the right hand side of the final plot. The first iteration plots correctly, but from then on the shifting of the xaxis occurs. I have tried reset, figure, newplot with various parameters, but to no avail. Help please! Thanks! Jeff
From: Jim Rockford on 21 Sep 2009 18:54 On Sep 21, 6:44 pm, "Jeff " <meyej...(a)students.ipfw.edu> wrote: > Hi - > I am calling the plot function from within a while loop, which produces about 30 separate plots. However, each succeeding plot moves the x-axis closer to the right, to the point where the xticks and labels are all crammed in on the right hand side of the final plot. The first iteration plots correctly, but from then on the shifting of the xaxis occurs. I have tried reset, figure, newplot with various parameters, but to no avail. Help please! > Thanks! > Jeff Sounds like you need to set plot properties like XLim. Within your loop try the following: hold('on'); % after the 1st plot set(gca,'XLim',[x0 x1]) % x0 = left edge lim for plot, x1 = right edge limit for plot (only need to do this once, I think)
From: Jeff on 22 Sep 2009 10:08
Thanks Jim! Turns out I only needed to add "xlim ([start finish]);" to the while loop code. Your direction to the command xlim was the key. Thanks alot! Jeff |