|On this page…|
Within each fit figure, you can display up to three plots simultaneously to examine the fit. Use the toolbar or View menu to select the type of plot to display:
Main Plot shows the curve or surface fit.
Residuals Plot shows the errors between your fit and your data
Contour Plot shows a contour map of a surface fit (not available for curve fits).
The next example shows a main plot with a curve fit and prediction bounds, and the residuals plot.
When you select Tools > Prediction Bounds, two additional curves (or surfaces) are plotted to show the prediction bounds on both sides of your model fit.
Choose which bounds to display: None, 90%, 95%, 99%, or Custom. The custom option opens a dialog box where you can enter the required confidence level.
See also Customizing the Fit Display.
On the residuals plot, you can view the errors between your fit and your data, and you can remove outliers. See Remove Outliers. This example shows a residuals plot with some excluded outliers.
If you fit a surface, then the main plot shows your surface fit. Click-and-drag rotation or Rotate 3D is the default mouse mode for surface plots in the Curve Fitting app. Rotate mode in the Curve Fitting app is the same as Rotate 3D in MATLAB® figures. You can change the mouse mode for manipulating plots just as for curve plots. See Using Zoom, Pan, Data Cursor, and Outlier Exclusion.
If you turn on a mouse mode for zoom, pan, data cursor or exlude outliers, turn the mode off again to return to rotate mode. For example, click the Zoom in toolbar button a second time to clear it and return to rotate mode.
If you have a surface fit, use the contour plot to examine a contour map of your surface. Contour plots are not available for curve fits. On a surface fit, a contour plot makes it easier to see points that have the same height. An example follows.
For polynomial and custom fits, you also can use the Tools menu to display prediction bounds. When you display prediction bounds, two additional surfaces are plotted to show the prediction bounds on both sides of your model fit. The previous example shows prediction bounds. You can see three surfaces on the plot. The top and bottom surfaces show the prediction bounds at the specified confidence level on either side of your model fit surface.
You can also switch your surface plot to a 2-D plot if desired. Your plot cursor must be in rotate mode. Clear any other mouse mode if necessary. Then, right-click the plot to select X-Y, X-Z, or Y-Z view, or to select Rotate Options. All these context menu options are standard MATLAB 3-D plot tools. See Rotate in 3-D in the MATLAB Graphics documentation.
You can change mouse mode for manipulating plots. Use the toolbar or Tools menu to switch to Zoom, Pan, Data Cursor, or Exclude Outliers modes.
The Curve Fitting app remembers your selected mouse mode in each fit figure within a session.
Use the toolbar or Tools menu to toggle mouse mode in your plots:
Zoom In, Zoom Out, Pan, and Data Cursor are standard MATLAB plot tools.
On surfaces, turn all these modes off to return to Rotate 3D mode. For surface plots, rotation is the default mouse mode in the Curve Fitting app. See Viewing Surface Plots and Contour Plots.
— Data Cursor selects data cursor mode, where you can click points to display input and output values.
— Exclude Outliers selects outlier mode, where you can click points to remove or include in your fit. Exclude outliers is a mouse mode for graphically excluding data from your fit. See Remove Outliers.
To customize your plot display, use the toolbar, Tools menu, or the View menu. See also Create Multiple Fits in Curve Fitting App.
— Legend toggles display of the legend on all plots in the currently selected fit tab.
— Grid toggles display of the grid on all plots in the currently selected fit tab.
Tools > Prediction Bounds lets you choose which bounds to display: None, 90%, 95%, 99%, or Custom. The custom option opens a dialog box where you can enter the required confidence level.
— Axes Limits opens a dialog box where you can specify upper and lower bounds for the X- and Y-axes of plots. Click Reset to return to the default axes limits.
Use the View controls to customize the display to show or hide the plots, fit settings, results and table of fits.
Available in the View menu and the toolbar:
— Main Plot toggles the display of the main fit plot in the currently selected fit figure. This item is disabled if only the main plot is displayed.
— Residuals Plot toggles the display of the residuals plot in the currently selected fit tab. This item is disabled if only the residuals plot is displayed.
— Contour Plot toggles the display of the contour plot in the currently selected fit tab. This item is disabled if only the contour plot is displayed.
View > Fit Settings toggles the display of the fit controls pane in the currently selected fit tab (Fit name, inputs, fit type, and so on).
View > Fit Results toggles the display of the Results pane in the currently selected fit tab. When you display the Results pane, you can see model terms and coefficients, goodness-of-fit statistics, and information messages about the fit.
View > Table of Fits toggles the display of the Table of Fits pane in the Curve Fitting app.
Tip For more space to view and compare plots, as shown next, use the View menu to hide or show the Fit Settings, Fit Results, or Table of Fits panes.
See also Displaying Multiple Fits Simultaneously.
In the Curve Fitting app, select File > Print to Figure to produce MATLAB figures from the results of curve fitting. Print to Figure creates a figure containing all plots for the current fit. You can then use the interactive plotting tools to edit the figures showing fitting results for presentation purposes, and export these in different formats.