Displaying 20 results from an estimated 20000 matches similar to: "Legend with fill = gray ?"
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
2004 Dec 09
4
Create a plot legend in a new window
Hi
I have a complicated plot which has a potentially large legend. What I
want to do is actually create the legend in a new window. Has anyone
done this before? I'd like to be able to create a window with just the
legend in it, and have it so the window is just the right size etc. I'm
sure someone must have done this already? If not, any tips would be
welcome.
Thanks
Mick
2010 Aug 30
3
Putting legend *outside* plotting area
Is there a simple way to put a legend outside the plot area for a simple
plot?
I found... (at http://www.harding.edu/fmccown/R/)
# Expand right side of clipping rect to make room for the legend
*par(xpd=T, mar=par()$mar+c(0,0,0,4))*
# Graph autos (transposing the matrix) using heat colors,
# put 10% of the space between each bar, and make labels
# smaller with horizontal y-axis labels
2010 Jul 22
1
Bar Plot Bars "Bleed" off Plotting Area
R Community,
I have a stupid little barplot I am trying to construct (Windows XP, R.11.1,
32-bit). Whenever I run it my bars run below the horizontal axis. Can anyone
(1) reproduce this and (2) offer a solution? Rather simplistic code follows
(I am new to the community)> Thanks for your help!
Greg Gilbert
=================== CUT HERE ===================
2016 Oct 25
2
Colores en names.arg de un barplot()
Hola.
Tengo un gráfico que tiene muchos names.arg (demasiados...), de modo tal
que le vendría bien al lector usar colores intercalados, tal que el primero
sea azul, el segundo negro, el tercero azul, cuarto negro, y así. Es decir,
definir un vector "similar" a este:
rep(c("black", "blue"), length(barras[,1]/2)
que permita pintar uno y uno en este gráfico:
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 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
2016 Oct 25
2
Colores en names.arg de un barplot()
Gracias, Javier. Está muy bueno el post, pero en efecto refiere a legend y
no a los names.arg
Adjunto un archivo para poder correr el gráfico. Creo que eso ayuda a
precisar el problema. Las etiquetas que aparecen al costado izquierdo de
las barras son las que quiere pintar de negro y azul.
También va a necesitar este objeto para que la sintaxis corra sin errores:
library(RColorBrewer) #Para
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
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
2006 Jan 05
4
ylim problem in barplot
R Version 2.2.0
Platform: Windows
When I use barplot but select a ylim value greater than zero, the graph
is distorted. The bars extend below the bottom of the graph.
For instance the command produces a problematic graph.
barplot(c(200,300,250,350),ylim=c(150,400))
Any help would be appreciated.
Paul
[[alternative HTML version deleted]]
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
2005 Mar 30
5
2d plotting and colours
Hi!
I am new to R just 3 days in it and i apologize if my questions seem very
trivial and consumed your valuable time.
I am coding in perl and i stumbled upon R regarding plotting good
statistical graphs.
I tried the kmean clustering for a large matrix ,say > 150 * 150 . I tried
the example code given in the tutorial to perform 2d plot
# i ranges from 2 to 10
cl <- kmeans(x, i, 20)
2009 Mar 27
3
color vectors other than gray()
I'm trying to create a graph where different cells of a grid (a shapefile)
will be painted with a color share scale, where the most easy way is to use
gray().
Can I somehow get a vector (gradient) of colors, a vector of colors with
other methods but gray()?
I'm doing this until now
quad_N_sp <-
2016 Apr 25
2
ylim in barplot()
Dear useRs,
I'm having troubles with using ylim in barplot(): even though I reduce
the y-scale using ylim, the bars still extend down to 0into the x-labels.
The sample data is below, and here is the code.
#This works fine but I would like to plot only from 50 to 70:
barplot(t(mydata), beside=TRUE, col=c("orange", "green", "yellow",
"purple"),
1999 Sep 20
3
image legend
Dear R users,
Does anyone have a function for putting a legend on an image
plot? I couldn't locate an R equivalent of image.legend....has
anyone written such a thing?
kind regards
andy
---------------------------------------------------------------------
J. Andy Royle, U.S. Fish and Wildlife Service - Office of Migratory
Bird Management; 11510 American Holly Drive , Laurel, MD
2012 Oct 19
5
RColorBrewer
Hi there everyone! So I'm a student in college, taking a very basic
Statistics course. We're using R for most of our assignments. I've hit a
pretty big wall here. I'm attempting to create a heat map of the entire
united states which corresponds to a set of percentages I have for each
state. My teacher suggested that I simply create a color palette with
RColorBrewer that is in the
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
2005 Aug 24
2
Remove NAs from Barplot
Dear List:
I'm creating a series of barplots using Sweave that must assume a
standard format. This is student achievement data and the x-axis must
include all grades 3 to 8. In some cases, the data for a grade (or more
than one grade) are missing in the vector math.bar, but are never
missing for the vector apmxpmeet. The following sample code illustrates
the issue.
Using the code below to
2016 Apr 25
0
ylim in barplot()
If you are using a Windows system, you can Export the plot from RStudio and save it as a metafile without using package devEMF and it will crop the bars with xpd=FALSE. When I used devEMF on a Windows machine, the bars were not cropped with barplot() as you indicated, but when I switched to plotrix::barp() they were cropped. The arguments are a bit different, but I did not need xpd=FALSE: