Displaying 20 results from an estimated 8000 matches similar to: "barplot with some 0 frequencies"
2010 Nov 20
3
how to add frequencies to barplot
Hi,
I have count data
x2=rep(c(0:3),c(13,80,60,27))
x2
0 1 2 3
13 80 60 27
I want to graph to be ploted as
barplot(table(x2),density=4)
how do I add relative frequency to it, like in
hist(x2,labels=T)
above the 'bar's
Thanks.
casper
--
View this message in context: http://r.789695.n4.nabble.com/how-to-add-frequencies-to-barplot-tp3051923p3051923.html
Sent from the R help
2012 Jul 30
2
barplot question
Dear r-help members.
I would like to:
a) control the margin around my legend box. Unfortunately I did not find an appropriate command under "?legend". The margin around the actual legend is way too wide. There is a lot of unnecessary "empty space" on the right side.
b) increase the width of the individual barplots. I saw that this can be obtained with the command
2017 Jan 27
4
Suggestion: barplot function
Hello developers folks!
First, congratulations for the wonderful work with R.
For science, barplots with error bars are very important. We were
wondering that is so easy to use the boxplot function:
boxplot(Spores~treatment, col=treatment_colors)
But there is no such function for barplots with standard deviation or
standard error. It becomes a "journey" to plot a simple graph (e.g.
2011 Jul 14
2
Problem with x labels of barplot
Hello everyone,
i am currently creating a barplot.
This barplot takes a vector of ~200 datapoints.
Each datapoint represents one bar.
http://img96.imageshack.us/i/human1w.png/
(Ok as you see, it is not only one barplot, but a series of barplots).
Now, these barplots represent a human chromosome. This means they are
ordered. For instance bar number 50, means position 50 in the human
chromosome.
2011 May 25
2
barplot groups of different size i.e. height is NOT a matrix
Hello,
I want to use the function barplot do display several group of bars.
A standard example is given at this link
http://onertipaday.blogspot.com/2007/05/make-many-barplot-into-one-plot.html
But in their example the 4 groups of bars are all composed of 8 bars.
I want to be able do display the same kind of graph but where the number
of bars in each group are not the same. For example the
2004 Jun 15
2
tapply/barplot (PR#6983)
Hello,
there seems to be a bug in tapply or barplot in R 1.9.0 that was not in =
earlier versions. The following code creates two nice barplots in 1.7.0, =
but the first one is bad in 1.9.0:
par(mfrow=3Dc(1,2))
x <- rep(1:10,10)
y <- runif(100,1,100)
z <- tapply(y,x,mean)
barplot(z)
barplot(as.numeric(z))
although is.numeric(z) returns TRUE!
Best regards,
Vidar Hjellvik
Institute of
2008 Aug 21
2
barplot with anchored bars
Dear R list members,
How to produce barplots anchored to the x-axis (not floating
above the x-axis) with a box around?
With both following codes, the lower horizontal line of the
box is below the y = 0 line:
# first code
x <- c(1,2,3,4)
barplot(x,yaxs='i')
box()
# second code
x <- c(1,2,3,4)
op <- par(yaxs='i')
barplot(x)
box()
par(op)
The parameter yaxs='i'
2009 Mar 18
2
multiple barplot
Dear all,
I want to put 9 barplots side by side. My code below only print 5 names from
9 names I gave.
Problem: how to print all of those 9 names? I use cex=0.8 but did not work,
it gave me error message.
d<-matrix(rpois(45,3),5,9)
barplot(d,beside=T,col=rainbow(5),names=c("CRTL","LSB","ONEMKR",
2003 Jan 17
2
barplot plotting problem
Hi,
Is there any equivalent of type="n" when constructing barplots which will
still construct the axes (plot=F, as it says doesn' plot anything at all).
Alternatively I tried setting col="white" and border="white" but the border
command does not seem to be operational. True??
Any other ideas? What I'm actually trying to do is construct vertical
abline()'s
2003 Nov 13
5
xlims of barplot
I would like to create a family of barplots with the same xlimits. Is
there a way to "read" the xlimits from the first graph so I can apply it to
the subsequent ones?
I have tried just taking the min and max of the x data and the plot doesn't
show.
cheers
[[alternative HTML version deleted]]
2010 Dec 19
2
barplot: width of label
Hello,
I try to make barplots with rather wide labels. A simplified example of
this:
x <- c(12, 33, 56, 67, 15, 66)
names(x) <- c('Richard with a long surname','Minnie with a long
name,'Albert','Helen','Joe','Kingston')
barplot(x, las = 2)
Now the label 'Richard with a long surname' is too long to fit beneath the
bars. A simple solution
2003 Feb 05
4
barplot default colors
Dear R-help,
Can some one explain why barplot() uses changing colors in the bars by
default? I should think that most of the time when people draw barplots,
they want the bars to be in the same color. (At least that's what I'd
expect. The first time I used barplot() in R, I was shocked to see the
colors.) As an example, one example in ?layout draws a scatterplot with
histograms drawn
2003 Feb 05
4
barplot default colors
Dear R-help,
Can some one explain why barplot() uses changing colors in the bars by
default? I should think that most of the time when people draw barplots,
they want the bars to be in the same color. (At least that's what I'd
expect. The first time I used barplot() in R, I was shocked to see the
colors.) As an example, one example in ?layout draws a scatterplot with
histograms drawn
2007 Jun 12
2
barplot and map overlay
Hi,
I wonder if it is possible with the graphics package to overlay one or several plots
(barplots, for example) over a map. Data for the map is in a data frame with the
latitude and longitude coordinates, and then:
> plot(map$long, map$lat, type ="l")
produces the map. I want to put each barplot in specific locations on the map, namely
at the center of "statistical
2009 Jun 02
5
how to add value on the bar ploted by barplot()
how to add value on the bar ploted by barplot()?
and the axis label is too big, anyone know how to change their font , thanks
--
Xiaogang Yang
Sensorweb Research Laboratory
http://sensorweb.vancouver.wsu.edu/
Washington State University Vancouver
[[alternative HTML version deleted]]
2012 Sep 06
2
No room for labels in barplot
All,
I have:
sales <- c(2300,900,155,102,42,10)
names(sales) <- c("Christmas","Valentine's Day",
"Mother's Day","Father's Day",
"Thanksgiving","New Year's Day")
barplot(sales,ylim=c(0,2500))
But it doesn't place all of the name labels on the plot. So I tried:
sales <-
2011 Sep 12
6
barplot in hexagram layout
dev.new(width=6, height=1.5,mar=c(0,0,0,0))
par(mfrow=c(1,1),mar=c(.5, .5, 1.5, .5), oma=c(.4, 0,.5, 0))
barplot(c(1,1,1,1,1,1),col=c("blue","purple","red","green","orange","yellow"),
axes = FALSE)
I have a barplot that returns six colors in a line. I would like to get the
same six color blocks in a hexagram layout (if it were a clock,
2009 Jan 20
2
Stacked barplot with two stacked bars besides each other
Hi,
I have a particular barplot I would like to generate, but I am having
trouble getting it to work. What I would like is in effect two barplots
with stacked bars merged into one. For example, I have two samples
(yoda1,yoda2) on which I measure whether two variables (var1,var2) are
present or absent for a number of measurements on that sample.
> var1 <- data.frame(yoda1=c(3,7),
2006 Oct 17
3
barplot question
i'm doing a bar plot and there are 16 column variables. is there a way
to make the variable names go down instead of across when you do the
barplot ?
because the names are so long, the barplot just shows 3 names and leaves
the rest out. if i could rotate the names 90 degrees, it would probably
fit a lot more.
or maybe i can use space to make the horizontal width longer ? I looed
up ?barlot but
2010 Aug 05
3
Plotting range of values in barplot()
Hello,
I am attempting to create a bar plot that contains a range of possible
response values on the x-axis of 1 to 5 and contains barplots for the number
of responses even in the event that there are 0 responses. For example, I
have a data set that contains values of 2, 3, 4, and 5 but I would also like
my graph to show that there are no 1's.
I have attached the resulting graph. The