Follow

How can I create a stacked graph with multiple Y axes in Grapher?

To create a stacked graph with multiple Y axes, you can add additional plots to the graph and add additional axes. Axes can be linked so that they stay in the same relative location, if desired. To create a graph with 1 horizontal X axis and 2 stacked Y axes, follow these steps:

 

Creating the Bottom Plot and Axes:

  1. Create the appropriate bottom graph. For instance, if the bottom graph should be a bar chart, click the Graphs | Create | Bar | Vertical Bar Chart command (Bar Chart Button).
  2. Select the data file and click Open. For this example, I selected the bar chart orientations.dat file located in the Grapher samples directory. The base graph is created.
  3. Normally, when there are two stacked Y axes, both axes are shorter, so all the data fits on one page. Click on Y Axis 1 in the Object Manager to select it.
  4. In the Property Manager, click the Axis tab.
  5. Change the Length to a smaller value. For a normal portrait page layout, you may want to make this 3-4 inches in length.
  6. Make any other changes to the Bar Chart 1, Y Axis 1, or X Axis 1, as desired. For instance, I have changed the X axis limits and the color and width of the bar chart in this example.

Grapher Bar Chart
The original graph contains 1 X axis, 1 Y axis, and 1 plot.

 

Adding a New Plot with a new Y axis:

  1. Click anywhere on the graph to select it.
  2. Click the Home | Add to Graph | Plot command ().
  3. In the Select Plot Type dialog, click your desired plot type and then click OK. For instance, you may select a Line Plot.
  4. In the Choose Axes dialog, change Y Axis 1 to Create new axis.
  5. Click the Position button.
  6. In the Position New Axis dialog, click X Axis 1 and select Y Axis 1. Ensure that At the top of is toggled and click OK.
  7. Click OK in the Choose Axes dialog.
  8. Select the data file and click Open. The new plot is added to the original X axis and a new Y axis positioned above the first Y axis.
  9. Click Y Axis 2 in the Object Manager to select it.
  10. In the Property Manager, click the Axis tab.
  11. Change the Length to a smaller value. For a normal portrait page layout, you may want to make this 3-4 inches in length.
  12. If desired, change the Y position value to a slightly greater number. This will add a space between the two axes.

 Grapher stacked bar chart and line plot
A stacked graph is created with 2 Y axes and 1 X axis. Both the line plot and bar chart use the bottom X axis.

Linking the Y Axes (optional):

  1. To keep the new Y axis in the same relative location, click on the Link Axis tab.
  2. Change the Link axis option to Y Axis 1.
  3. Check the boxes next to Link X position and Link Y position. Now, when the bottom Y axis moves, the top Y axis will, as well.
  4. If the axes should always be the same length, check the Link length box. When the bottom Y axis length changes, the top one will, as well.

 

Updated September 18, 2018

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.