Displaying 20 results from an estimated 20000 matches similar to: "Thin bars in R hist !!??"
2006 Aug 10
2
hist() and bar spacing
Hello,
Could someone explain to me why I get so different histograms, in terms of
bar spacing, depending on the number of counts entered ? (see example below)
> test <- c(0,1,1,1,1,0,0,0,0,0,2,3,2,2,2,3,3,4,5,6,7,5,4,3,4,2,2)
> hist(test)
I obtain this kind of histogram (what I actually want), i.e. large bars with
no space between them
x
xx
xxx
xxxx
xxxxx
xxxxxx
2010 Jan 28
1
hist - unevenly spaced bars
I am sure this is trivial, but I cannot solve it.
I make a histogram. There are 5 categories "1",...,"5" and 80 values and
the histogram does not evenly space the bars.
Bars "1" and "2" have no space between them and the rest are evenly spaced.
How can I get all bars evenly spaced?
The code:
> Q5
[1] "4" "4" "4"
2005 Jan 05
1
hist.POSIXt filled bars - axis color changes
Hi all,
I'm plotting a histogram of dates and would like to shade the bars, e.g.
hist(.leap.seconds,"years",col='gray',freq=T)
-but the axis color also changes, how do I prevent that?
thx in advance
Janus
[[alternative HTML version deleted]]
2002 Dec 12
3
y axis on hist
Hi:
The y axis on the hist function seems to set its limits oddly.
sometimes, it covers the full range of the data and sometimes it stops
one major tick short. I have had this behavior with a variety of data
sets, and it can easily be reproduced by just running the following
several times:
hist(rnorm(100000))
I have tried explicitly setting ylim to the range of values produced by
rnorm
2010 Dec 01
2
How to draw a rect() behind a hist() ?
Hi,
I have the following code:
hist(gps$heartpercent, breaks=5)
rect(90, par("usr")[3], 100, par("usr")[4], col = "red")
How do I get the rectangle to appear behind the histogram. Barring that,
how can I make certain bars of the histogram to be a certain color?
Thanks,
Jason
2003 Sep 18
2
hist will not use parameter xaxs (PR#4219)
Full_Name: Mark Wall
Version: 1.6.0
OS: linux
Submission from: (NULL) (63.251.119.254)
I want to plot a histogram of a *subset* of some data:
>t = c(0:9)
>hist(t,right=FALSE,breaks=10,xlim=c(0,5),xaxs="i")
This means I should plot a histogram from 0 to 5 with breaks at 1,2,3,4. This
should produce exactly 5 bars of frequency=1. Instead I get 5 and 1/4 bars. I
do not want the
2009 Jun 01
1
Bug in hist() when working with Dates ?
Hi,
It seems that hist() has a buggy behavior when breaking over "days".
The bug can be reproduced in a few steps:
> d=data.frame(date=c("2009-01-01", "2009-01-02", "2009-01-02"))
> d$date=as.Date(d$date)
> d$date
[1] "2009-01-01" "2009-01-02" "2009-01-02"
> h=hist(d$date, "days")
> h$count
[1] 3
2007 Jun 14
3
problem with hist()
Hey everybody,
I try to make a graph with two different plots.
First I make a boxplot of my data. It is a collection off correlation
values of different pictures. For example:
0.23445 pica
0.34456 pica
0.45663 pica
0.98822 picb
0.12223 picc
0.34443 picc
etc.
Ok, I make this boxplot and I get for every picture the boxes. After this
I want to know, how many correlations per picture exist.
So I
2004 Jun 17
3
disappointed with x-axes in hist and density plots
I've got a few issues with the x-axes in the histogram and density plots. First,
often the default x-axis doesn't even extend to the length of my data. R often draws
histogram bars (or density lines) farther than the drawn x-axis extends. For example,
I might have a histogram bar at -15,000. But I wouldn't know that, because the most
negative number on the x-axis is -10,000. The
2003 Mar 08
2
hist() basic question
Hi,
This is a very basic question, but I would like to undestand hist(). I
thought that the hist( , freq=FALSE) should provide the relative
frequencies (probabilities), and so they should sum 1, however:
set.seed(2)
ah <- hist(rnorm(100), freq=F)
sum(ah$intensities)
[1] 2
set.seed(2)
bh <- hist(rlnorm(100), freq=F)
sum(bh$intensities)
[1] 0.4999996
I'm getting similar figures with
2010 Jun 11
2
r code to broaden the boarder of the bars of a histogram
To whom it may concern,
I have a problem concerning the design of a histogram. How do I change
the border widths of the bars of a histogram. The initial command is:
hist (punkte,breaks=30, xlab="Punkte", ylab="H?ufigkeit",
main="Histogramm", col= heat.colors(30), border= "red")
I suspect that it has to do with the "lwd" command but can't
2005 Nov 02
2
breaks in hist()
Dear listers,
A quick question about breaks in hist().
The histogram is highly screwed to the right, say, the range of the vector is [0, 2], but 95% of the value is squeezed in the interval (0.01, 0.2). My question is : how to set the breaks then make the histogram look even?
Thanks in advance,
Leaf
2009 Jun 04
3
Understanding R Hist() Results...
Think I'm missing something to understand what is going on with hist(...)
http://n2.nabble.com/What-is-going-on-with-Histogram-Plots-td3022645.html
For my example I count 7 unique years, however, on the histogram there only 6. It looks like the bin to the left of the tic mark on the x-axis represents the number of entries for that year, i.e. Frequency.
I guess it looks like the bin for
2005 Sep 25
4
hist(x, ...) with normal distribution curve
.
I am looking for a histogram or box plot with the adding normal
distribution curve
I think that must be possible, but I am not able to find out how to do.
Regards Knut
2007 Apr 13
3
labels cut partially on hist
Dear List,
I have the following function where I plot on one page a histogram and a boxplot.
I use option labels = TRUE in hist to show labels. However the label on the highest bar in the
histogram is not showing entirely. How can I correct this?
Thanks for any suggestions?
histtst <-
function(n = 100,...){
set.seed(15) # makes rnorm reproducible
par(mfrow = c(2,1))
x <-
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.
2006 Oct 06
2
hist plot
Hi there,
I really couldn't find out how to plot histogram with point/line instead of rectangle for each bin? Any help please? Thanks!
Best,
-Cao
2005 Dec 11
1
(PR#8376 inconsistency between plot(hist(...)) and hist(...)
On Sun, 11 Dec 2005 clausen at econ.upenn.edu wrote:
> Full_Name: Andrew Clausen
> Version: 2.1.0
> OS: Debian GNU/Linux
> Submission from: (NULL) (71.242.192.73)
>
>
> Hi,
>
> When I type
>
> hist(x, freq=F)
>
> I get a density function, as I expect. However, if I type
>
> plot(hist(x, freq=F))
>
> then I get the same output as if I had
2005 Apr 06
3
Error in hist.default(A) : `x' must be numeric
Dear everybody!
I have load a list A of numbers and want a histogram to be drawn.
on
hist(Y)
the Machine returns:
Error in hist.default(A) : `x' must be numeric
I found out, that the list is of type data.frame.
Y<-as.numeric(Y)
returns
Error in as.double.default(A) : (list) object cannot be coerced to double
What schould I do?
Than you in advance!
2004 Sep 01
2
using hist() with tapply()
Hi,
I've been passing the hist() function to tapply() to quickly generate histograms based on the list of factors supplied to tapply(). However, I have not figured out how to generate titles for each of the histograms, which paste in the unique values of the list factors as part of the histogram title. I'm hoping that someone can tell me how to do this.
Thanks for your time and