Displaying 20 results from an estimated 10000 matches similar to: "Adding bars to the right of existing ones using barplot"
2012 Mar 02
2
Spacing of text does not match spacing of bars in barplot
I have a very standard barplot. My labels are too long to be printed
horizontally under each bar, so I am using text to put the labels on a 45
degree slant.
However, the labels are spaced more narrowly than the bars, so on an 8
vertical bar plot, the end of the eighth label is lined up with the seventh
bar.
Preferably I don't want to do every text label separately (I'm having this
2005 Jan 13
1
Space between bars in barplot
Hi
I am trying to understand the "space" argument to barplot() and I think
it is not working as stated. The docs say:
space: the amount of space (as a fraction of the average bar width)
left before each bar.
Which means that I can pass a vector, the same length as the no. of
bars, and the nth element of that vector will be the space left before
the nth bar. This is
2005 May 30
3
values of bars in barplot
Hi,
I couldn't find how to have the values written on the
top of each bar in a barplot. When using hist(), it is
possible to use labels=T, but this option does not
seem to exist for barplot().
Is there a trick I could use to do that ?
Thanks to all
Luc
2009 Dec 15
2
Diagonal Labels on "Beside" Bars in Barplot
My question is based on an example provided in the following:
Referencing:
Statistics with R
Vincent Zoonekynd
<zoonek at math.jussieu.fr>
6th January 2007
URL:
http://zoonek2.free.fr/UNIX/48_R/all.html
data(HairEyeColor)
a <- as.table( apply(HairEyeColor, c(1,2), sum) )
# Provided Example
barplot(a, beside = TRUE,
legend.text = attr(a, "dimnames")$Hair)
# I
2007 Aug 04
2
bars' values on barplot
Hi,
I need bars' values on barplot, and I don't know how I can put it. I do my
barplot as:
data<-read.table("/my_path/file.dat",header=T, sep="\t")
barplot(as.matrix(data),log="y",beside=TRUE,main="my_title", xlab="x name",
ylab="y name").
How can I add the values on each bar?
Thanks..
[[alternative HTML version deleted]]
2003 Dec 23
1
How can I put error bars on a barplot() ?
Hi all,
I am a relatively new R user... trying to put error bars (from SD values) on my data represented with barplot(). But I can't find any function or instruction to do so.
Is there an easier way to do this than using segments() as I saw in an example in the R reference manual ? Then, can I define there graphical apparence ?
Thanks for help.
Regards
Olivier BUHARD
[[alternative HTML
2005 Dec 13
2
Labeling a range of bars in barplot?
Hi, I am plotting a distribution of (ordered) values as a barplot. I
would like to label groups of bars together to highlight aspects of the
distribution. The label for the group should be the range of values in
those bars.
As this is hard to describe, here is an example;
x <- rlnorm(50)*2
barplot(sort(x,decreasing=T))
y <- quantile(x, seq(0, 1, 0.2))
y
plot(diff(y))
That last
2009 Feb 27
2
add absolute value to bars in barplot
Hello,
r-help at r-project.orgbarplot(twcons.area,
beside=T, col=c("green4", "blue", "red3", "gray"),
xlab="estate",
ylab="number of persons", ylim=c(0, 110),
legend.text=c("treated", "mix", "untreated", "NA"))
produces a barplot very fine. In addition, I'd like to get the
1999 Aug 26
1
error bars on barplots
Hello again
I'm trying to put error bars onto a barplot. I've tried something that
Bill Simpson suggested a while ago, ie:
x<-c(1,2,3,4,5)
y<-c(1.1, 2.3, 3.0, 3.9, 5.1)
ucl<-c(1.3, 2.4, 3.5, 4.1, 5.3)
lcl<-c(.9, 1.8, 2.7, 3.8, 5.0)
plot(x,y, ylim=range(c(lcl,ucl)))
arrows(x,ucl,x,lcl,length=.05,angle=90,code=3)
#or
segments(x,ucl,x,lcl)
but I can't get it to work on a
2010 Sep 15
2
barplot: space between axis and bars
Hi all,
I have a problem with a rather simple plot (which I have used several
times) - barplot.
I want to create a barplot, where no space is between the axis and the bars.
Example:
barplot(rnorm(10), space=0)
creates a vertical axis at the left and bars. I want to skip the space
between both.
Thank you for your help.
Daniel
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 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),
2011 Jan 25
2
barplot with varaible-width bars
I would like to produce a bar plot with varying-width bars. Here is an example to illustrate:
ww <- c(417,153,0.0216,0.0065,556,256,0.0162,0.0117,
+ 726,379,0.0358,0.0501,786,502,0.0496,0.0837,
+ 892,591,0.0785,0.0795)
yy<-t(t(array(ww,c(2,10))))
barplot(yy[,2*1:5],las=1,space=c(.1,.5),beside=T)
produces a barplot of 5 pairs of bars that are of equal width
2010 Apr 24
2
barplot - offsetting individual bars
Hello,
I'm trying currently using barplot to summarize precipitation data. So far
I've compiled total annual snow and rain accumulation in a table
(attached). I've been successful at plotting it using the following code:
fig=barplot(t(Annual_Precip_table), horiz=TRUE, space=0, col=c("grey70",
"white"), axes=FALSE)
.
.
The result is a stacked barplot with total
2010 Mar 22
3
add information above bars of a barplot()
hi,
I have a barplot with six clusters of four bars each.
Now I would like to add the exact value of each bar as a number above the bar.
I hoped to get some tips here.
I could simply add text at the different positions, but I don't understand how the margins on the x-axis are calculated
(how can I get / calculate the x-ticks of a barplot?).
Also I would like to code this flexible enough so
2007 Jan 25
1
barplot x-axis problem
Hi R-users,
I'm new to R and I'm trying to make a barplot combined with two lines
(refering to secondary y-axis). Bars should represent the number of
transfused patients by age class and sex and lines should represent
the amount of blood units given in age classes. I have now successfully made
a barplot and used par(new=TRUE) to plot another empty graph at the top of
the barplot.
2003 Oct 30
1
legend over-prints barplot bar
When I create a bar plot, the legend is obscuring the rightmost bar.
I haven't found a setting that appears to affect the positioning of the legend - any tips re moving the legend would be most appreciated.
paul sorenson
2005 Jun 30
2
How to rotate the axisnames in a BARPLOT
Hi all,
- how can I do a barplot with rotated axis labels? I've seen the example for
just a plot in the FAQ, but I'll missing the coordinates to plot my text at
the right position beneath the bars.
Is there any (easy?) solution?
- how can I set the y-axis in a barplot to logarithmic scale?
Many thanks in advance!
Best Regards
Tom
--
2011 Jan 12
1
Grouped bars in barplot
Dear all,
I am trying to make a barplot with clustered pairs of bars, using class=numeric data and the following command:
barplot(c(bline_precip[10,9], bline_runoff[10,9], cccma_precip[10,9], cccma_runoff[10,9], csiro_precip[10,9], csiro_runoff[10,9], ipsl_precip[10,9], ipsl_runoff[10,9], mpi_precip[10,9], mpi_runoff[10,9], ncar_precip[10,9], ncar_runoff[10,9], ukmo_precip[10,9],
2004 Apr 16
2
barplot() does not draw bars correctly in R 1.9.0 (PR#6776)
Bars are not stacked, but superimposed. This happens even with the first
example of barplot:
tN <- table(Ni <- rpois(100, lambda=5))
r <- barplot(tN, col='gray')
--please do not edit the information below--
Version:
platform = i386-pc-mingw32
arch = i386
os = mingw32
system = i386, mingw32
status =
major = 1
minor = 9.0
year = 2004
month = 04
day = 12