I do it a bit differently:
Once you've got myhist, you can plot a line on the existing histogram
plot with something like:
smoo<-spline(myhist$breaks[1:length(myhist$breaks)-1],myhist$counts)
lines(smoo$x,smoo$y,col='green')
You'll have to muck a bit with scale factors to make the spline curve
Look here:
http://msenux.redwoods.edu/mathdept/R/CentralLimit.php
D.
On Jun 15, 2008, at 11:25 PM, Gundala Viswanath wrote:
Hi,
Currently I have a density plot generated with this
snippet.
Is there a way I can add a line curve on top of it?
I mean in one figure
__BEGIN__
myhist <- hist
nt: Monday, June 16, 2008 8:25 AM
Subject: [R] Superimposing Line over Histogram in Density Plot
Hi,
Currently I have a density plot generated with this
snippet.
Is there a way I can add a line curve on top of it?
I mean in one figure
__BEGIN__
myhist <- hist(x
Hi,
Currently I have a density plot generated with this
snippet.
Is there a way I can add a line curve on top of it?
I mean in one figure
__BEGIN__
myhist <- hist(x
col="blue",
main = "Density Plot",
xlab = "Exp Level",
)
__END__
- Gundal
4 matches
Mail list logo