Displaying 20 results from an estimated 30000 matches similar to: "Part of density plot not showing up"
2010 Aug 13
1
Lattice: Superimposing histograms with different colors and transparency effects
Dear users,
I would like to plot several histograms superimposed on the same panel
with different colors, with superimposed polygons appearing with
transparency effects. I also want estimated densities to appear on the
same plot. For several reasons, including that I like it, I want to use
the lattice package.
I have several questions regarding the use of the 'histogram' function
with a
2000 Nov 17
2
hist() and density
There were some questions about hist() a couple of days ago which
triggered this post. My question/suggestion is about the y-axis in hist.
There are reasons to prefer making the y-axis density=relative
frequency/bin width. One reason is that the height of the plot does not
depend on the bin width; another is that if your histogram is in density
then you can easily superimpose a smooth theoretical
2011 Nov 01
1
Superimpose xversus y plot on a histogram of x
I need a plot with a histogram z and a plot of z versus y superimposed.
This is not working...
z = rnorm(1000)
y = rnorm(1000,1,2)
hist(z)
dx = plot(z, y, lwd = 1)
lines(dx, add=TRUE)
--
Thanks,
Jim.
[[alternative HTML version deleted]]
2008 Apr 23
1
Density estimation
Hi,
I am analysing a dataset containing genetic distances within and between
species. I want to show a overlap of the distributions of the intra- and
interspecific values; on a second graph I use a cut-off value to determine
these boundaries. As the dataset contains >30 000 values, I would like to do
this with a simple line rather than superimposed histograms. Hence, density
plots. With
2011 Mar 20
3
Part of a density plot
Suupose I have
y <- rbeta(10000, 2, 5)
and I only want to see only the density plot from x = 0 to x = 1
How do I do this?
--
Thanks,
Jim.
[[alternative HTML version deleted]]
2005 Dec 13
8
superimpose density line over hist
Hi all,
I'm trying to superimpose a rchisq density line over a histogram with
something like:
hist(alnlength)
lines(density(rchisq(length(alnlength), 4)),col="red")
But the rchisq line won't appear anywhere,
Anyone knows what I am missing here?
Thanks in advance,
Albert.
2011 Jun 09
1
histogram - density on y axis and restriction to interval [0, 1]
Hello,
To indicate probability densities instead of counts on a histogram, I
specify freq = FALSE.
However, I expect that summing all top y coordinates over all the
intervals of the histogram will provide 1.
1)
v <- c(0.2885, 0.2988, 0.3139, 0.2615, 0.3179, 0.3163, 0.2583, 0.3052,
0.2527, 0.3147, 0.3235, 0.2408, 0.2480, 0.3108, 0.3577, 0.2829, 0.2694,
0.3275, 0.3314, 0.2639, 0.3076,
2009 Jul 26
2
problems hist() and density
Hello,
I have a problem with the hist() function and showing densities. The
densities sum to 50 and not to 1! I use R version 2.9.1 (2009-06-26) and
I load the seqinR library.
My data is the following vector:
[1] 0.1400000 0.2000000 0.2200000 0.2828283 0.1600000 0.1600000
0.3600000
[8] 0.1600000 0.2200000 0.2600000 0.2000000 0.3000000 0.2200000
0.2342342
[15] 0.1800000 0.2200000 0.1600000
2008 Jun 16
4
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
col="blue",
main = "Density Plot",
xlab = "Exp Level",
)
__END__
- Gundala Viswanath
Jakarta - Indonesia
2007 Mar 08
2
curve of density on histogram
Hi R users,
I would like to know why these following curve densities don't appear
correctly on the histograms.
Thank you for your help
library(lattice)
library(grid)
resp <- rnorm(2000)
group <- sample(c("G1", "G2", "G3", "G4"), replace = TRUE, size = 1000)
histogram(~ resp | group, col="steelblue",
panel = function(x, ...){
std
2009 Apr 28
3
truehist and density plots
Hi,
I wanted to plot the histogram of a vector and then, plot the density function of subsets of the vector on the histogram. So I use truehist in MASS package and lines(density) as follows:
length(b) = 1000
truehist(b)
lines(density(b[1:100]))
however the density plot of the first 100 points exceeds the max of y axis (see attached). how is it possible to make a graphics so that the density plot
2004 Jun 04
1
hist, lines, rug
Hello,
I'm trying to plot a historgram with a density plot superimposed:
hist(x, seq(-1, 1, by = 0.1), prob = T, col = "blue")
lines(density(x, bw = 0.1))
rug(x)
I don't want to add rug(x) but the histogram will not be plotted unless
rug(x) is there. It does not work if the "hist" line alone is present.
Can you help?
Thanks,
Kim
[[alternative HTML version
2008 Jul 05
3
trying to superimpose a line plot onto a histogram
Hello,
I'm trying to superimpose a line plot onto a histogram but I'm not having
any luck. I've attached the dataset. What I did was:
> hist(data,freq=F)
Now I'm trying to superimpose the following points with a line connecting
them onto the histogram:
x y
100 0.535665393824959
200 0.212744329736556
300 0.0844933242968584
400 0.0335572838043417
500
2006 Aug 10
3
Multiple density curves
Hi,
I am new to R...a recent convert from SAS.
I have a dataset that looks like this:
SEQ A1 A2
A 532.5 554.5
B 25.5 35.5
C 265.2 522.2
D 245.55 521.56
E 546.52 141.52
F 243.25 32.56
G 452.55 635.56
H 15.14 16.54
I 543.4 646.56
J 54.4 654.5
K 646.5 64.54
L 645.4 614.46
M 646.54 634.46
I want to make a histogram
2008 Aug 07
2
histogram - freq=FALSE - density computation
Hi,
I don't understand what
hist(x, freq=FALSE)
does.
At first I thought it would be just the relative frequencies instead
of the absolute frequencies,
by just computing "frequencies / n" in every category.
But with a small dataset the y-values (densities) don't sum to one.
Is there a way to get the histogram doing that?
Or what is the idea of this density-computation?
1999 Jun 07
0
How to superimpose a histogram and density plot
NCSS has a nice plot of the histogram and density plot superimposed. The
S-PLUS 4 Guide to Statistics on page 45 suggests the following code for a
general purpose density plot for a vector named data
iqd <- summary(data)[5]-summary(data)[2]
plot(density(data,width=2*iqd),xlab="x",ylab="",type="l")
Is it possible to superimpose the density plot on a histogram
2011 Jan 13
3
Question about histogram
Dear list,
I'm new to R, please bear with my silly questions. I'm trying to get an
understanding of why the results I get from a call to hist() are not as
I thought I would get. When I use the parameter freq=FALSE, I think the
plot will contain bars that none of them is larger than 1, because
they're probabilities. But for my code, the bars exceeded 1.
The actual data seems
2006 Apr 05
1
hist function: freq=FALSE for standardised histograms
Dear All,
I am a undergraduate using R for the first time. It seems like an excellent
program and one that I look forward to using a lot over the next few years,
but I have hit a very basic problem that I can't solve.
I want to produce a standardised histogram, i.e. one where the area under
the graph is equal to 1. I look at the manual for the histogram function and
find this:
freq:
2010 Sep 21
5
Combined plot: Scatter + density plot
Hi,
in order to save space for a publication, it would be nice to have a
combined scatter and density plot similar to what is shows on
http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=78
I wonder if anybody perhaps has already developed code for this and is
willing to share. This is the reproducible code for the histogram
version obtained from the site:
def.par <-
2011 Aug 22
2
CDFs
Hello all,
I have two columns of numbers. I would like to do the following:
(1) Plot both cdfs, F1 and F2 on the same graph.
(2) Find smoothed approximations of F1 and F2 lets call them F1hat and F2hat
(3) Find values for F1hat when we substitue a value of x in it.
(4) Find the corresponding densities of the cdfs.
Any ideas?
--
Thanks,
Jim.
[[alternative HTML version deleted]]