
On a worksheet, type the input data in one column, adding a label in the first cell if you want.īe sure to use quantitative numeric data, like item amounts or test scores. For more information, see Load the Analysis ToolPak in Excel. Geom_histogram(aes(y=2*(.density.)/sum(.density.)), breaks=seq(0,200,5), alpha=0.Make sure you have loaded the Analysis ToolPak. This seems kind of kludgy and there may be a more elegant approach. In general, you have to multiply by n, where n is the number of groups. So you have multiply by 2 in order for the total density of each group to be individually normalized to 1. (.density.)/sum(.density.) results in the total density over the two histograms adding up to one, and the total density of each individual group adding up to 0.5. UPDATE: In answer to your comment, the following code should do it. ggplot(dat, aes(x, fill=group, colour=group)) + If you want to make overlayed density plots, you can do that as well.

Ggplot(dat, aes(x, fill=group, colour=group)) + Ggplot2 makes it relatively straightforward to plot normalized histograms of groups with unequal size. Now I've been successful overlaying the un-normalized data using this method: and also with this method: plotting two histograms togetherīut I'm stuck when it comes to how to overlay normalized data Since there are more measurements in one data frame than the other, obviously I have to normalize, so I use: read.csv(ctl)

Overlaid or Side by Side would be great to do this.

1-.2 um^3 and compare it with how many in data frame 2 are between. I have two data frames of different lengths and would like to plot the volume of the objects in each df as a histogram. Following the advice that I've found, I'm able to do one or the other, but not both operations.

I realize there have been several posts for people asking how to plot two histograms together side by side (as in one plot with the bars next to each other) and overlaid in R and also on how to normalize data.
