There is not currently a way to create a stacked histogram in Grapher. Please let us know if you would like to vote for this feature. However, there is a workflow that can be used to display the data in the same manner. To do this, create a histogram from each group separately. Export the data and create stacked bar charts from the exported data. The steps below detail how to do this.
-
- Create a histogram for the first group using the Home | New Graph | Statistical | Vertical Histogram (
) command.
- In the Object Manager, click the Histogram to select it.
- Set any properties, including the bin size, worksheet rows, etc. Only the data from the first group should be used.
- Click the Graph Tools | Plot Tools | Export Data command. A new worksheet is created.
- The worksheet separates out the data into bins, counts, and frequency. I would recommend changing column C (Upper Limit) using the Data Tools | Data | Transform command. Use the equation C=C-5, where 5 is half of the bin size.
- Repeat steps 1 - 5 for each of the histogram groups.
- In a new plot window, click the Home | New Graph | Bar | Vertical Bar Chart (
) command.
- Select the first data file created with step 4 and click Open.
- Click on the bar chart to select it in the Object Manager.
- In the Property Manager, click on the Plot tab.
- Change the X column to Column C.
- Change the Y column to Column B.
- Click on the Fill tab.
- Change the Foreground color to the desired color.
- Click Home | Add to Graph | Plot.
- Select Vertical Bar Chart and click OK.
- Click OK in the Choose Axes dialog.
- Select the second worksheet created with step 4 and click Open.
- Click on the new bar chart to select it.
- In the Property Manager, click on the Plot tab.
- Change the X column to Column C.
- Change the Y column to Column B.
- Click on the Fill tab.
- Change the Foreground color to the desired color.
- Repeat steps 10-14 for each additional histogram group.
- With any of the bar charts selected, click on the Bar Groups tab in the Property Manager.
- In the Bar Chart 1 field, click New Group. Group 1 appears in the field.
- For each of the Bar Chart fields, select the Group 1 option.
- If needed, change the Stacking option from Adjacent to Stacked on the Plot tab.
The histogram is now displayed with each group a separate color and the histogram bars adjacent to each other.
- Create a histogram for the first group using the Home | New Graph | Statistical | Vertical Histogram (
The histogram is now displayed with each group a separate color and stacked.
Updated August 2, 2019
Comments
0 comments
Please sign in to leave a comment.