Displaying 20 results from an estimated 8000 matches similar to: "Overlaying a moving average curve on top of a barplot"
2002 Sep 23
3
Newbie: Subsets of data frame
I feel a bit embarassed by this, but I have not managed to find out how:
I have a data frame containing measurements over time for a number of
different locations:
> str(milk)
`data.frame': 845 obs. of 3 variables:
$ date : num 1987 1987 1987 1987 1987 ...
$ value : num 5 1 2 5 1 1 2 3 2 4 ...
$ location: Factor w/ 36 levels "Alta","And?y",..: 1 1 1 1 1 1
2003 Mar 14
2
plot
Can anyone tell me how to plot on the same graph two different functions
(of x) using two differnt y scales (axes 2 and 4)?
Thanks
Nelson
2002 Dec 13
2
A beginner's problems with plotting
Hi,
How would I go about plotting all 8 columns of a data.frame on a simple line
graph. i.e. eight lines and sets of points, differentiated by line pattern or
colour)?
An what further arguments would I need to invoke a log scale on the y-axis of
that same plot (normal x-axis)?
Cheers, Jeremy
2003 Jan 21
2
Plot using different symbols depending on value.
I am making a plot from R indicating an average, min and max value for a
number of sample types. as horizontal lines with the sample types on the
y-axis. (see http://home.newmedia.no/sickel/R.html for the plot and code) In
some cases, the min value is the detection limit, and I would like to
indicate that bu using a <, rather than the usual | I use for indicating the
value.
I am plotting each
2002 Sep 17
2
grid.legend - lines
I am testing out the grid-plots, but get into a problem making a legend. I
have a line plot and some points, following the model in
grid.plot.and.legend() i manage to get the points correctly in the legend,
but what do I do with the line? (Of cource, I can just draw a line at the
right location on the plot, but I would prefer to use legend)
Morten
--
Morten Sickel
Norwegian Radiation
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
2005 Jun 22
2
Subsetting across a frame for plotting
I have a huge frame holding holding model results for a number of
locations and time series:
> str(tonedata)
`data.frame': 434 obs. of 339 variables:
$ VALUE : int 101 104 105 106 111 118 119 121 122 123 ...
$ COUNT : int 2443 184 1539 1016 132 1208 1580 654 864 560 ...
$ AREA : num 6.11e+08 4.60e+07 3.85e+08 2.54e+08 3.30e+07 ...
$ D1_1958 : num 470 446 452 457 407 ...
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
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
2006 Mar 06
2
barplot names.arg
How can i set a rotation for the names.arg 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
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
--
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"),
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
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
2016 Sep 06
2
Gráfico de Barras
Hola.
Siguiendo a Mittal (2001); R Graph Cookbook creo haber logrado construir el
gráfico de barras que buscada. La matriz que utilizo para el "height" va
adjunta.
Y mi sintaxis:
barplot(t(barras), col=col.segmentos, border=F
, names.arg=Meses, las=2, cex=.75, cex.axis=0.8
, ylab="% del Segmento sobre el Total")
legend(.5, .2, ncol=5, cex=.75,
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
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
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")
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',