Displaying 20 results from an estimated 10000 matches similar to: "Labeling a range of bars in barplot?"
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 May 27
3
Labeling barplot bars by multiple factors
I want to plot quantitative data as a function of three two-level factors.
How do I group the bars on a barplot by level through labeling and spacing?
Here <http://www.thomaslevine.org/sample_multiple-factor_barplot.png>'s what
I'm thinking of. Also, I'm pretty sure that I want a barplot, but there may
be something better.
Tom
[[alternative HTML version deleted]]
2005 Feb 18
4
barplot and ylim - display problems
The following single line of code shows what I am trying to do, and the
problem I am having...
barplot(c(101,102,103),ylim=c(100,103))
The 'xaxis' is missing, and the grey bars 'fall off' the plot area. This
is generally ugly, and I would like to trim the bars (ideally they would
have a ragged appearance to show that I am 'zooming in').
I can see why what I am trying to
2010 Jan 15
1
Possible to write text inside a bar of a barplot?
How can I write text inside a bar of a barplot? I tried using text(), but I
am only able to specify the numeric y-coordinate. The different columns of
my barplot correspond to factors and not numbers, so I don't know how to
access the horizontal positions of the bars. I tried fiddling with different
values of the "adj" argument, but this appears unreliable.
Background: I have
2008 Oct 29
2
Barplot: Vertical bars with long labels
Dear List,
I need a barplot with vertical bars. Each bar should have a label.
The problem is, that the labels are too long, so they overlap, or
only every seccond label is displayed in the output.
Here is a little syntax:
dd <- c(100,110,90,105,95)
barplot(dd,names.arg=c('Conduct Disorders','Attention Deficit',
'Eating Disorders',
2004 Apr 16
0
barplot() does not draw bars correctly in R 1.9.0 (PR#6778)
On Fri, 16 Apr 2004 09:59:02 -0400 Duncan Murdoch wrote:
> On Fri, 16 Apr 2004 15:44:52 +0200, Achim Zeileis
> <Achim.Zeileis@wu-wien.ac.at> wrote :
>
> >On Fri, 16 Apr 2004 11:40:46 +0200 (CEST) phgrosjean@sciviews.org
> >wrote:
> >
> >> Bars are not stacked, but superimposed. This happens even with the
> >> first example of barplot:
>
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 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
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),
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
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
2004 Apr 16
0
barplot() does not draw bars correctly in R 1.9.0 (PR#6777)
On Fri, 16 Apr 2004 11:40:46 +0200 (CEST) phgrosjean@sciviews.org wrote:
> Bars are not stacked, but superimposed. This happens even with the
> first example of barplot:
>=20
> tN <- table(Ni <- rpois(100, lambda=3D5))
> r <- barplot(tN, col=3D'gray')
AFAICS, this problem occurs exactly for 1-way tables like above. If
barplot(as.vector(tN), col =3D
2008 Jun 03
0
problems on plotting adjacent bars with barplot. Help request, please
hi ladyes and gentlemans of the R comunity.
i have the following graphical issue:
# say y is a matrix or a dataframe with
dim(51,nrow=17),hence 3 columns;
l<-51
# now the 3 colums represents 3 different aspects of
my continuous variable (3 factors),plotted against a
categorical one;
n<-levels(factor(x))
# i want to plot those 3 factors adjacently using the
barplot(), and possibly show
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],
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
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]]
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
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
2008 Oct 08
4
Space between bars in barplot
Hi,
with the "space" parameter it is possible to change the gap / distance
between the bars, but is it also
possible to change the "space" after each 6th bar?
So for example you have bars from 1 to 6 then a large gap and then the next
six bars from 7 to 12
Thanks a lot!
--
View this message in context:
2004 Dec 02
1
Gap between axis and bars in barplot()
Hi
Windows XP, R 2.0.1.
I am drawing a very large barplot using jpeg() - setting the width to
10,000 as there are over 5000 bars.
This all works fine and I get exactly what I want - except there is a
huge bit of white space between the Y-axis and the first bar - so much
in fact that I have to scroll two screens from the Y-axis before I see
the first bar. After that the bars are evenly spaced