Displaying 20 results from an estimated 10000 matches similar to: "legend over-prints barplot bar"
2003 Nov 13
5
xlims of barplot
I would like to create a family of barplots with the same xlimits. Is
there a way to "read" the xlimits from the first graph so I can apply it to
the subsequent ones?
I have tried just taking the min and max of the x data and the plot doesn't
show.
cheers
[[alternative HTML version deleted]]
2003 Nov 04
2
more barplot presentation questions
Thanks to those who pointed me at the solutions to the legend overprinting the bars. I took the "easy" way of rescaling the y axis, picking the scaling factor for stacked bars is somewhat problematic but sufficient for my application.
I have another couple of barplot questions:
- Can I extend the major ticks on the Y axis across the page? Or both axes to form a grid?
- A really
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
2002 Nov 12
4
trouble positioning legends on barplot written to a file
I'm trying to generate some plots for print publication and I'm having trouble
getting them the way I want. I get a plot with a legend that overlaps the bars
and looks bad. Also, I'm saving this as PDF file (whatever happened to the
"png" function to save as PNG format, in r 1.4.1?)
I've tried a number of things, which produce a number of questions.
1) it seems that the
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
2006 Oct 13
3
Barplot legend position
Dear useRs,
I'm trying to create a barplot like so:
x=matrix(1:10,2,5)
barplot(x,leg=c("left","right"),besid=T)
The legend is placed in default position topright, however the data are
plotted there too. I tried controlling the legend position by adding
x="topleft" but this results in an error that x matches multiple formal
arguments.
Leaving out the legend
2003 Mar 21
1
barplot legend size
Dear R-people,
are there any way to change the size of legend in barplot? I have
tried various versions of cex, both as par(cex.*= ) and barplot(...,
cex.*= ). So long without success.
Sincerely,
Ott
> version
_
platform i686-pc-linux-gnu
arch i686
os linux-gnu
system i686, linux-gnu
status
major 1
2004 Nov 03
4
Legend placement in barplot?
This has been asked before, but all the answers are hidiously complex.
The
legend.text=TRUE
option of barplot is almost exactly what I need, except I need a
legend.placement='tl'
(top left) option. This option would be in contrast to the default
placement which we could call 'tr' (top right).
Anyone know how to edit the barplot code to make this change? Could
someone like me
2005 Apr 18
3
Barplot and colors for legend
Hi all!
One quick question: How do I get the standard colors
used by barplot? I have
some stacked bars and would like to add a horizontal
legend via legend() but I
don't know how to find the colors for the fills of the
legend points.
Thanks!
Werner
2011 Mar 20
1
legend position in "barplot"
Hi, R users,
I there a way that I can control the position of the legend while using
"barplot" function?
For example:
a<-matrix(c(0,0,0.5,0.8,0.9,0.9),2,3)
colnames(a)<-c("X","Y","Z")
rownames(a)<-c("A","B")
a
barplot(a,width = 0.2,legend =
TRUE,axes=FALSE,col=c("coral3","steelblue3"),beside=TRUE)
In this
2012 Jun 13
2
adjust space between horizontal legend text in a barplot
Hi All,
I produced a barplot and made a horizontal legend below the graph.
Because the results are from a survey, there are three levels, namely
strongly disagree/disagree, neutral and strongly agree/agree.
> rownames(survey)[1] "Strongly disagree/disagree" "Neutral" "Strongly agree/agree"
As in the output above, there is a large space
2010 Sep 01
3
how to represent error bar in a plot legend?
I have a simple barplot of 4 mean values, each mean value has an
associated 95% confidence interval drawn on the plot as an error bar.
I want to make a legend on the plot that uses the error bar symbol, and
explains "95% C.I."
How do I show the error bar symbol in the legend? I could not find any
"pch" values that are appropriate
Thanks
[[alternative HTML version
2009 May 06
1
Positioning a legend via X and Y coordinates
Dear R Users,
I'm able to display a legend using the following code:
> legend("topright", c("Simulation", "Observation"), fill=2:3, bty="n")
However, this causes the legend to be positioned too close to the bars in my barplot. I'd like to move the legend up slightly. I have been trying to determine the necessary values by trial and error to do
2012 May 09
1
barplot: legend: two rows
dear r-helpers,
i have got another question:
i am using the functions
par(xpd=T)
legend
to create a legend below the x-axis. i used the parameter horiz=T.
now i would like to put the elements of the legend in two rows:
e.g. if my legend has got 5 elements, i would like 3 elements in one row
and the last two elements in the next row.
does anyone know how to do that?
thank you very much for
2008 Jun 13
1
Switching the order of legend boxes in a lattice bar graph
I suspect there is a simple solution to this problem, but have been
unable to find it. Below is some code that I have run to create 3
lattice graphs. I have been asked to change the legend so that the
'No' and dark blue are above "Y" and light blue in the legend to
mirror the stacked bars in the graph which feature dark blue above light blue.
I have tried changing the data
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
2016 Aug 04
1
findInterval(all.inside=TRUE) for degenerate 'vec' arguments
What should findInterval(x,vec,all.inside=TRUE) return when length(vec)<=1,
so there are no inside intervals?
R-3.3.0 gives a decreasing map of x->output when length(vec)==1 and -1's
when length(vec)==0. Would '0' in all those cases be better?
> findInterval(x=c(10, 11, 12), vec=11, all.inside=TRUE,
rightmost.closed=FALSE, left.open=FALSE)
[1] 1 0 0
>
2010 Dec 19
2
barplot: width of label
Hello,
I try to make barplots with rather wide labels. A simplified example of
this:
x <- c(12, 33, 56, 67, 15, 66)
names(x) <- c('Richard with a long surname','Minnie with a long
name,'Albert','Helen','Joe','Kingston')
barplot(x, las = 2)
Now the label 'Richard with a long surname' is too long to fit beneath the
bars. A simple solution
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
2011 Aug 29
1
Legend / bar order - ggplot2
Hi all,
I am trying to do a barplot in ggplot2 and want to make sure that the legend order is consistent with the bar order, that is the legend order is orig and match; and the bars are ordered in the same way. It seems to me that I can only control one of them. Any idea?
library(ggplot2)
df <- data.frame(value = rnorm(20),
name = factor(rep(letters[1:10], 2), levels =