Search the Knowledgebase |
Browse by Category |
|
|
|
| I want to draw a line through some of my data points and get the equation. Can I? |
| User Opinions |
40%
60%
|
|
Thank you for rating this answer.
|
Yes! Grapher does have the ability to create a fit curve, limited to an X range of data, and get the equation for this range. Here are the steps you would need to create the graph, add the fit curve, and get the equation:
- Create a line/scatter plot using the Graph | 2D XY Graphs | Line/Scatter command. Select the data file and click Open.
- Click once on the line/scatter plot and choose Graph | Change Plot To | Scatter. Now, you have a scatter plot.
- You can click on the Symbol tab in the Property Manager to change symbol properties, if you prefer. Your scatter plot will look something like this:

- Click once on the scatter plot to select it. In the Property Manager, click on the Plot tab. Click the Fits command where it says <Click here to add/edit fits>.
- Select Linear, click Add, and click OK. You now have a fit curve added to the graph. But, this default fit curve uses all of the data points to create the equation of the line.
- Click on the fit curve to select it. In the Property Manager, open the Data limits section. Uncheck the Use curve limits box. You can then type in a Minimum value and Maximum value. These are X values. You want to give the program the range of data that you want to use. So, if you want to limit the equation to the red area on this graph, type in 25 for the Minimum value and 88 for the Maximum value.

- If you need to determine what the X range is based on the circled area, the simplest way to do this would be to use the Graph | Digitizing | Digitize command. After selecting this command, hover over the far left side of the red area to get the X minimum value and the far right side of the red area to get the X maximum value. The values are shown in the status bar at the bottom of the Grapher window. Press ESC to end digitizing mode. Then, type in these values for the Minimum value and the Maximum value.
- After changing the fit curve Data limits properties, your fit curve will be reduced to the area highlighted by the red ellipse. You should see something like this:

- If you want the curve to extend the full length of the graph, but be based on only the selected data points, open the Plot interval section. You can change the Plot limits to Axis limits to extend to the full data set. Or, you can select Custom to type in your own First X and Last X values. The fit curve will then be extended to these X values.
- You can clip the fit curve to the axes on the Clipping tab.

- Finally, to get the equation of the line, click once on the fit curve. In the Property Manager, open the Plot tab. Open the Statistics section. Click on any of the commands in the Statistics section to get the fit information. Clicking on the Clipboard command copies the information to the Windows clipboard for pasting into other programs. Clicking the Report command opens a small text window in Grapher with the fit curve information. Clicking the Insert statistics command allows you to click on the Grapher plot window and have the fit curve information displayed next to the graph.
|
| Visitor Comments |
|
No visitor comments posted. Post a comment
|
| Attachments |
|
No attachments were found.
|