I have this r code in ggplot to do a plot
ggplot(ab,aes(x=pk1)) + geom_histogram(binwidth = 0.5, position=
position_dodge(0.5), color="black",fill="cadetblue4")+ ggtitle("Histogram of
PK1")+labs( x="PK1", y="Number of
Observations")+geom_density(aes(y=0.5*..count..))+
scale_x_continuous(breaks=seq(0,10,0.5))
I want to have a separate y-axis on the right side with the actual values of the PDF rather than doing aes(y=0.5*..count..)
to the original plot to make the curve fit. I want both the histogram and density curve on the same plot.