similar to: trouble positioning legends on barplot written to a file

Displaying 20 results from an estimated 20000 matches similar to: "trouble positioning legends on barplot written to a file"

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
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
2005 Jul 04
1
Rotate legends or other approaches to nice legend placement?
I'm sure this general sort of question has been asked many times before - I would _like_ automatic and sensible legend placement in barplots so data is not overwritten... but since there doesn't seem to be one, one of the following would be useful: One approach for this would be to place the legend to the right of the graph, and rotate it by 90 degrees. Is there a sensible way to do
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"),
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:
2016 Apr 26
1
ylim in barplot()
Thank you David, That's a nice workaround using plotrix::barp(), but that doesn't explain why ylim doesn't work as intended (or at least, as I expect it to work), or why xpd has no influence when using devEMF::emf()... The problem with saving directly in RStudio is that it requires to manually save the plot, and this becomes troublesome when there are a lot of plot commands in a
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
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)
2010 Sep 01
2
Legend with fill = gray ?
Hi, I am facing a problem with the legend, I don?t know how to use the fill option in the legend in order to achieve the same standard gray levels that are plotted. Sorry for this easy one, but I really did not find anything so far. It works fine with color: ###### C O L O R mat <- matrix(2,3,rep(2,6)) rownames(mat)<-c("A","B","C") par(xpd=T,
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
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
2009 Jun 02
5
how to add value on the bar ploted by barplot()
how to add value on the bar ploted by barplot()? and the axis label is too big, anyone know how to change their font , thanks -- Xiaogang Yang Sensorweb Research Laboratory http://sensorweb.vancouver.wsu.edu/ Washington State University Vancouver [[alternative HTML version deleted]]
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 Jun 30
1
FW: plot legend outside the grid
-----Original Message----- From: Ghosh, Sandeep Sent: Thursday, June 30, 2005 5:43 PM To: 'Berton Gunter' Subject: plot legend outside the grid Thanks for the pointers... I managed to get everything to look and feel the way I want except for the legend to plot outside the grid... Thanks for the note on the par, but I'm not able to it to plot outside the plot grid.. dataFrame <-
2005 Aug 29
1
ylim for graphic
Dear list: I have some data for which I am generating a series of barplots for percentages. One issue that I am dealing with is that I am trying to get the legend to print in a fixed location for each chart generated by the data. Because these charts are being created in a loop, with different data, my code searches the data to identify the maximum value in the data and then print the data values
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:
2012 Jul 30
2
barplot question
Dear r-help members. I would like to: a) control the margin around my legend box. Unfortunately I did not find an appropriate command under "?legend". The margin around the actual legend is way too wide. There is a lot of unnecessary "empty space" on the right side. b) increase the width of the individual barplots. I saw that this can be obtained with the command
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
2006 Apr 10
2
Legend in the outer margin
Dear Rs I have a 3x3 multiple plot. I would like to have a overall legend in the outer right margin. From the help archive, I found that it can be done by setting par(xpd=NA). However, I couldn't find the correct values for x and y co-ordinates for the legend. Please find the code snippet below: par(mfrow=c(3,3), mar=c(4,4,0.9,0.5), oma=c(1,2,2,4),cex.main=1.1)