Displaying 20 results from an estimated 10000 matches similar to: "Space between bars in barplot"
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
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
2011 Jun 02
1
Adding a line to a beside=TRUE barplot
Greetings –
Grateful for any help on this one:
In the following demo code, I am trying to get the points in the line to
appear over the same x-axis labels as are used by the paired Bars. It
appears, however, that R/lattice ignores the x-axis points used by the bars
and plots the x points for the line at ½ points.
Can you help me tweak this code so that the nth bump in the line
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
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
2007 Mar 13
3
Adding bars to the right of existing ones using barplot
I'm trying to create a barplot that has two sets of data next to each
other. I'm using barplot with the add=TRUE option, but this simply
adds the second dataset on top of the first, obscuring it. How do I
add the new data to the right on the existing barplot so that both
sets are visible? I've been playing with all sorts of option and
reading the list archives with no
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]]
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'
2006 Dec 01
3
Make many barplot into one plot
Dear all,
## I have 4 tables like this:
satu <- array(c(5,15,20,68,29,54,84,119), dim=c(2,4),
dimnames=list(c("Negative", "Positive"), c("Black",
"Brown", "Red", "Blond")))
dua <- array(c(50,105,30,8,29,25,84,9), dim=c(2,4),
dimnames=list(c("Negative", "Positive"),
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
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
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
2003 Feb 03
4
Overlaying a moving average curve on top of a barplot
I''m using standard barplot (Windows version 1.6.2 of R) to represent a certain weekly metric "v" and I would like to properly overlay on top of it its moving average "mean.8" (window of 8 weeks). I must be doing something wrong since the moving average (using "lines") doesn''t overlay properly, i.e., both x-scales do not match!
...
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
--
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.
2002 Nov 13
2
Putting value labels inside the bars of a bar plot
I'd like to label a bar plot with the actual value of each bar, inside the
bar. I see that there are ways to plot arbitrary text, so I could do it
'manually', but this seems common enough that there's probably a simple
solution. I don't see it in the high-level documentation for barplot, and
haven't found it anywhere yet. How might this be done?
Thanks,
Tom
2009 Jul 27
3
numbers on barplot
Hello all,
I have this simple barplot code:
ifn <- "id.dat"
dat <- read.table(ifn)
ofn <- "id.png"
bitmap(ofn, type = "png256", width = 30, height = 30, pointsize = 30, bg =
"white",res=50)
par(mar=c(5, 5, 3, 2),lwd=5)
par(cex.main=1.6,cex.lab=1.6,cex.axis=1.6)
names(dat)<-c("NumberOfPeople","Average")
2003 Dec 18
2
barplot & plot together
Dear colleges,
I'm trying to combine a barplot and a plot in a single figure as follows:
data <- 1:6
t <- barplot(data, axes=F)
par(new= T)
plot(t, data, type="b")
However, as you can see in the example, the dots of the second plot do
not fall in the midpoint of the bars in the first. Any trick for setting
the 2 plots at the same scale?
I have unsuccessfully tried:
plot(t,
2006 Oct 02
5
Barplot
Hello,
I have used the following data to draw my barplot:
BL LR Q
36.35 1.00 1.92
36.91 4.00 0.00
25.70 6.00 0.00
34.38 3.00 1.92
05.32 0.50 0.00
BL<-c(36.35, 36.91, 25.70, 34.38, 05.32)
LR<-c(1.00, 4.00, 6.00, 3.00, 0.50)
Q<-<(1.92, 0.00, 0.00, 1.92, 0.00)
barplot(dt$LR, main='LR Value', col='orange', border='black',
2010 Oct 29
2
make many barplot into one plot
Dear R users
I would like to group my barplot graph (see example on the R help link). The proposed R code, adding individual bars to the plot, looks really overwhelming. My specific dataset just consists of five groups and three different levels within each groups (the individual bars). The .txt file is read as matrix (horizontal: group, vertical: levels).
The R trellis barchart (function