How can I maintain axis scaling while checking "Plot residuals" in "Basic Fitting" in MATLAB 7.5 (R2007b)?

1 view (last 30 days)
I have created a 2D plot and then I have tried to interpolate the obtained curve through "Basic Fitting" tools, following this sequence of operations:
1) Create the data for the plot
x = linspace(1,20,100);
y = sin(x);
plot(x,y,'r')
2. Choose Tools -> Basic Fitting: the default axis limits are x = [0 20] and y =[-1 1].
3. Check "Center and scale x data" to avoid bad conditioning and choose 9th degree polynomial.
4. Check "Plot Residuals". The view changes due to a rescaling of y axis.
5. Uncheck "Plot Residuals". The view doesn't come back to the initial one.
Hereafter, there is no way to get the original view from "Basic Fitting".

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
The change in axis limits actually occurs when the you check a fit and not when "Plot Residuals" is checked. If you uncheck the curve corresponding to 9th polynomial curve you will get the original view.
If you want to plot both curves with the original axis settings you can reset to the original view through the AXIS command or changing y limit values:
1. Open figure's "edit" menu
2. Choose "Axes properties" item
3. Manually change values in the "Y Axis" pan

More Answers (0)

Products


Release

R2007b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!