Displaying 20 results from an estimated 10000 matches similar to: "barplot() using beside=TRUE and the density argument"
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
2001 Jul 20
2
angle/density in barplots/polygon
I'm trying to convert some S-Plus code which generates barplots and
other shaded area plots to R. If I specify that I want hatching
using the angle and density arguments, the messages
1: argument `density' is not used (yet) in: .NotYetUsed("density", error = FALSE)
2: argument `angle' is not used (yet) in: .NotYetUsed("angle", error = FALSE)
so apparently these
2003 Dec 04
1
assigning colors to barplot when beside=TRUE
dear list,
i am having trouble coloring the bars in a barplot. my data have two
groups, which i would like to plot side by side. within each group i
want to sort the observations in decreasing order, like a pareto
chart. the bar colors would relfect the value of a third variable.
below i have generated a reproducible example. the bar heights are a
given pig's "gain",
2002 May 19
3
How to shade part of a density plot
I'm trying to shade part of a density plot. The code I'm trying (using
the Old Faithful data as an example) is something like this:
# The Old Faithful geyser data
data(faithful)
d <- density(faithful$eruptions, bw = "sj")
plot(d)
polygon(d[d$x>4], col = "wheat")
I expected that the part of the curve to the right of 4 on the x axis
should be shaded, but nothing
2012 Sep 06
1
Change margin size of complex barplot
Dear R-help members,
with the help of one of you the following R-Code was developed. No I have the (probably simple) problem that I want to increase font size of "text" and "ylab" names from 1 to 2. Unfortunately I'm not able to adjust the margin so, that the plot is appers complete (all names readable) on a 8:14 Inch scale plot.
Some times I get the error message that
2004 Apr 19
1
barplot fill patterns
Dear R-helpers,
I will like to know if there is a way to generate a stacked column
graph using both patterns and colors to fill the bars. I have many
categories for the number of color available in R, so I will like R to
start with solid colors and then use patterns an colors. I have been
using barplot and some code that I found in the archives, but I am
still having bars with the
2005 Feb 07
2
barplot: space makes beside=F (PR#7668)
Full_Name: Ondrej Medek
Version: 2.0.1
OS: Linux/Debian Sarge
Submission from: (NULL) (147.32.127.204)
Hi,
I had a R version 1.5.1 and I used a 'barplot' with 'beside=T' and 'space' has
been vector of 8 numbers 'space=c(1,0.5,rep(c(0.5,-0.5),3))'. Then I upgraded to
the R 2.0.1 and my graphs are broken. If I use any vector of more than 2
elements for
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
2011 Jul 01
1
Reverse legend label order in barplot
Hi list,
I've thus far not found a solution to my problem and hope someone can help.
I have a data matrix and wish to plot a stacked bar plot using barplot().
This is simple enough, but I have a problem with the legend labels being in
the reverse order from what I want. The default appears to have labels
ascending bottom-to-top reflecting bottom-to-top sub-bars, but I would like
the
2001 Aug 28
2
Christmas tree graphs
Hello R users,
I wish to draw a type of horizontal bar chart for two groups (males and
females). The values for one group will start at the y-axis and point to the
left, and the values for the other group will start at the y-axis and point to
the right. If you're (un)lucky, the resulting graph can assume the shape of a
Christmas tree.
The data are
left.side <- c(107092, 113053,
2006 Mar 08
1
Adding polygons to a barplot
I have a barplot I have created using barplot2 and I have been able to
add points and lines (using the points and lines methods,
respectively). I now need to add some polygons (triangles in
particular), that I want to be shaded to match bars in the plot. I
can get the coordinates of the corners of the triangles, but don't
know how to draw the triangles. I know there is the grid.polygon
2006 Feb 21
2
rotated labels in barplot with beside=T and multiple groups
I have a data set that I display using barplot. I don't know what you
call it, but when I look at it, it looks like this:
> lsu
(0,0.1] (0.1,0.2] (0.2,0.3] (0.3,0.4] (0.4,0.5] (0.5,0.6]
A 0.052631579 0.000000000 0.000000000 0.000000000 0.000000000 0.000000000
B 0.000000000 0.000000000 0.001007049 0.003021148 0.000000000 0.000000000
E 0.200000000 0.000000000
2003 Apr 16
2
barplot2
Hello,
I get a nice looking barplot using the barplot2 function in the gregmisc
package:
body2 <- barplot2(hh3, beside = TRUE,
col = c("mistyrose", "lightcyan"),
....
cex.names = 1.0, plot.ci = TRUE, ci.l = cil, ci.u = ciu,
plot.grid = TRUE)
box()
However, obviously I lose the collors when converting from ps to a pdf
(outside of R)
2005 Jul 13
3
texture in barplots?
Dear R list,
For some reason I am unable to access neither search.r-project.org, nor
http://finzi.psych.upenn.edu/ so I cannot search the archives for a possible
answer (I Googled for this but didn't find anything).
Is it possible to draw barplots using a texture instead of colors, for a black
and white printer?
TIA,
Adrian
--
Adrian Dusa
Arhiva Romana de Date Sociale
Bd. Schitu
2011 Feb 19
1
barplot, different color for shading lines and bar
Dear all,
might there be a modified barplot function out there which allows the user
to specify a fill color for the bars and independent parameters for the
overlaid shading lines ?
Currently, when I specify density and col, the fill color for the bars is
white.
Thanks!
Markus
[[alternative HTML version deleted]]
2005 Feb 18
3
Barplot - Can't figure it out
Hi,
I have two catagorical vectors like this;
x = c(1, 2, 4, 2, 1)
y = c(2, 4, 2 ,4, 1)
I want to set up a barplot with the catagories 1-4 horizontally and
number of occurances vertically for each vector x,y. I've tried
boxplot(table(x,y), beside=T)
and
boxplot(c(x,y), beside=T)
among others, but can't get it to work...Any ideas? I'd apppreciate any help
2008 Jul 25
4
Matrix barplot
Hi,
as a bloody R beginner I failed to solve the probably simple problem
to create a barplot of the following data read from a file
Year A B C
2000 4 3 0
2001 2 1 3
2002 1 2 5
The Barplot should look like
5 | C
4 | A C
3 | AB C C
2 | AB A C BC
1 |
2012 Sep 25
1
Bug or misunderstanding of par(pin)?
Dear all,
I am currently trying to create a plot showing multiple single plots, for
which the important issue is that the size of each plot region (not figure
region!) has to be of a fixed dimension (in my case: width=1 inch, height=
0.87 inches).
I tried to use "pin" to fix the plotting region to a specific size, but
without success.
The following example will visualize the problem:
2009 Apr 08
0
Customize Legend in Juxtaposed Barplot
Hello, I'm making barplots out of binary data, typically 0=no 1=yes,
but in some instances I have 2=Don't Know.
Anyway, when I create a juxtaposed barplot, what appears in the legend
is 0,1,and 2.
I want it to read No, Yes, Don't Know.
I'm not sure how to do that.
In addition to this, the other variable that this juxtaposed barplot is
grouped by is grade level, which is a
2011 Sep 12
1
Centering lines on barplot centers.
Hello,
I am trying to port one of my plotting S+ functions to R and I am having
difficulties!!! I am including here only the troublesome code!
I first produce a barplot, saving the positions of the bar's centers.
par(mar = c(6.1, 5.1, 4.1, 4.1), mgp = c(3, 3.0, 0))
ticks.loc <- barplot(sum.of.weights, col = 5, xlab = "", ylab = "",
axes =