Skip to content
Prev 385666 / 398503 Next

how to overlay two histograms

On 2020-09-17 17:01 -0500, Ana Marija wrote:
Dear Ana,

you need to specify stat="identity" [1], 
like so:

	mapping <- ggplot2::aes(
	  x=CHR,
	  y=counts,
	  fill=name)
	p <-
	  ggplot2::ggplot() +
	  ggplot2::geom_bar(
	    data=d,
	    mapping = mapping,
	    position="dodge",
	    stat="identity")

Best,
Rasmus

[1] https://stackoverflow.com/questions/61068031/error-stat-count-can-only-have-an-x-or-y-aesthetic

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20200918/8f6f13a4/attachment.sig>