Create Vertical Lines in a Graph

The XY Function Plot can be used to easily plot vertical lines in a graph. A vertical line can be plotted as a function of the form X = F(Y) = C, where C is a constant value.

This example will demonstrate plotting two vertical lines on the step plot.grf sample file and adding a fill between the plots.

Creating XY Function Plots

The following process demonstrates how to create two vertical lines with XY function plots.

  1. Click the File | Open command.
  2. In the Open dialog, select the step plot.grf sample file and click OK. The step plot sample file is located at C:\Program Files\Grapher\Samples\step plot.grf by default.
  3. Select Graph 1 in the Object Manager.
  4. Click the Graph Tools | Add to Graph | Plot command.
  5. From the list, select Function Plot - X = F(Y).
  6. Click OK in the Choose Axes dialog.
  7. Select Function Plot 1 in the Object Manager.
  8. Click the Plot tab in the Property Manager.
  9. In Plot Options, change X = F(Y) = to 8.
  10. Click the Data Limits tab in the Property Manager.
  11. Change the Y minimum to 0.
  12. Click Yes in the Grapher Preview Warning dialog.
  13. Change the Last value to 180 (the Y axis maximum).
  14. Click the Graph Tools | Add to Graph | Plot command.
  15. From the list, select Function Plot - X = F(Y).
  16. Click OK in the Choose Axes dialog.
  17. Select Function Plot 2 in the Object Manager.
  18. Click the Plot tab in the Property Manager.
  19. Change the X = F(Y) = to another constant, such as 12.
  20. Click Yes in the Grapher Preview Warning dialog to change the Y axis limit minimum.
  21. Click the Data Limits tab in the Property Manager.
  22. Change the Y minimum to 0.
  23. Change the Last value to 180.

After completing the steps above, vertical lines plotted at X = 8 and X = 12 have been added to the step plot graph.

 

Add a Between Fill

The following steps demonstrate how to add a fill between the two XY function plots.

  1. Select Graph 1 in the Object Manager.

  2. Click the Fill tab in the Property Manager.

  3. Click the Add button in the Add fill field. Fill 2 will be added to the Fills list.

  4. In the Plot one list select Function Plot 1.

  5. In the Plot two list select Function Plot 2.

  6. In the Fill style section, change the Direction to Horizontal.

A between fill is added to the graph between the vertical lines. Notice by default the fill uses the same properties as the existing between fill.

 

Function plots were used to create vertical lines at X=8 and X=12.

 

See Also

Function Plots

Property Manager

Object Manager

Fill Between Plots