similar to: legend

Displaying 20 results from an estimated 9000 matches similar to: "legend"

2012 Feb 15
2
assign same legend colors than in the grouped data plot
Dear community, I've plotted data and coloured depending on the factor variable v3. In the legend, I'd like to assign properly the same colors than in the factor (the factor has 5 levels). I've been trying this but it doesn't work. plot(var1, var2, xlab = "var1", ylab = "var2", col =var3 , bty='L') legend(locator(1),c("level 1 var3",
2010 Jan 12
1
Multiple symbols per single line in a legend
Hello everybody, Is it possible to coax legend() into displaying more than one simbol per line in legend? I have a graph like the one attached to this mail; I would like to reorganize the legend in such a way that the duplicate text would be omitted, i.e., the first line would read <square> <triangledown> "increasing frequency" and the second one would read <circle>
2012 Aug 15
1
legend position help
Hi there, I draw a multiple figure in one plot, like the following: par(mfcol=c(1,5),mar=c(4,4,0,0)+0.2, oma=c(0,0,3,0)) plot(1:10, type = "b") plot(1:10, type = "b") plot(1:10, type = "b") plot(1:10, type = "b") plot(1:10, type = "b") Now, I hope to plot the legend like the following: legend("top", legend=c("Example"), pch
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 Jul 27
3
Counting frequency within each range
Hi, This is a simple problem, but for the life of me I cannot find the answer. How to determine frequency within given ranges ? I know that table() gives frequency, for example a <- table(numbers) > a numbers 4 5 23 34 43 54 56 65 67 324 435 453 456 567 657 2 1 2 2 1 1 2 1 2 1 3 1 1 1 1 > as.data.frame(table(numbers)) numbers
2011 Aug 15
2
A small nag
Hi, I am not sure how to fix the following error. LGD <- c(11.6, 12.3, 15.8, 33.1, 43.5, 51.3, 67.3, 84.9) cor (x=(file [1:47231,3:10]), y= rep (LGD, 47231), method = "pearson") Error in cor(x = (file[1:47231, 3:10]), y = rep(LGD, 47231), method = "pearson") : incompatible dimensions > sessionInfo() R version 2.13.0 (2011-04-13)
2018 May 02
0
Merging dataframes
Hi, I'll coded your example into R code: Table_A <- c('abc at gmail.com', 'John Chan', '0909') Table_A <- rbind(Table_A, c('bcd at yahoo.com', 'Tim Ma', '89089')) colnames(Table_A) <- c('Email', 'Name', 'Phone') Table_A Table_B <- c('abc at gmail.com', 'John Chan', 'M',
2012 Apr 11
1
Merging multiple .csv files
Hi all, I wish to merge 24 .csv files, each having a common identifier-column ("Name") and do two things: 1. Retrieve the common one's. [Analogy: while merging 2-dataframes, similar to using: merge (.... ,by="Name", all=FALSE) ] 2. Retrieve all, i.e., the union of the rows of 24 files. [again, somthing like: merge (.... ,by="Name", all=TRUE) ] On the web,
2013 Apr 15
1
Kruskal-Wallis
Hi, I have got two groups of samples; and for every row, I wish to calculate Kruskal-Wallis' p-value. In the example below, and the stars (****) show where I am struggling to design and put things together. Any help would be appreciated. myFile <- data.frame(Sample_1a = 1:10, Sample_1b = 2:11, Sample_1c = 3:12, Sample_2a=4:13, Sample_2b=7:16, row.names=LETTERS[1:10]) groups <- rep
2018 May 02
2
Merging dataframes
Thanks - Peter, Eivind, Rui Sorry, I perhaps could not explain it properly in the first go. Trying to simplify it here with an example - Say I have two dataframes as below that are NOT equally-sized data frames (i.e., number of columns are different in each table): Table_A: Email Name Phone abc at gmail.com John Chan 0909 bcd at yahoo.com Tim Ma
2012 Jun 08
2
changing font to italic for one entry in legend()
Hello, I need to change the font for one of the items (C. elegans) in my legend to italic. Can someone suggest how to accomplish this? legend('bottomright', bty='n', c('C. elegans range', 'Study area'), cex=0.8, fill=c('light gray', 'white'), border=c('black','black')) I tried using lab.font=c(1,3) but R ignored and did not write
2009 Aug 27
1
Wishlist: specify the border color of boxes in legend() (PR#13913)
I could not find a way to specify the border color of the boxes drawn in a legend, so that the legend can match exactly the colors of the actual plot (e.g. in the case of two superimposed histograms which have different shading and different borders). Indeed, the legend function seems to hard code the color "black" for the borders in this call: rect2(left = xt, top = yt +
2004 Mar 25
1
Error in 'legend' help?
Dear all, maybe I have misunderstood something but to me it seems like a minor error in the help for ?legend for the argument 'bg'. There it says: bg: the background color for the legend box. (Note that this is only used if 'bty = "n"'.) I think, however, that it should be changed to: bg: the background color for the legend box. (Note that this
2010 May 17
1
Loess fit
Hi, I wonder why my attempt to extend an existing loess fit to a new data set is producing error. I was trying the following: dat = read.csv(choose.files()) x = dat[,2]; y = dat[,1] x.sort = sort(x) y.loess = loess(y~x, span=0.75) # For testing the above fit with a new dataset: test = read.csv(choose.files()) # test data new_x = test [,1]; new_y = test[,2] new_x.sort = sort(new_x) predicted
2012 Sep 24
2
Rows not common in dataframes
Hi, I have two dataframes (Dataframe_A, Dataframe_B) with the same no. of columns. The first column of both the dataframes contains unique names. I wish to have Dataframe_A with the rows that are NOT common to Dataframe_B. With merge (), it is possible to get the common rows or to merge rows, but I am not quite sure how to do it in a simpler way. Any help would be much appreciated. Thank you.
2012 Jul 31
2
Significance of correlation
Hi, I understand that to test the significance of correlation between two PAIRED variables, the function, cor.test () can be used. However, in my case, I have tested the correlation (i.e., Correlation Coefficient, r) between two independent (i.e, different) variables, and now I wish to test for the statistical significance of the correlation. Could you please suggest how I should do that. Thank
2008 Aug 11
2
: bquote inside legend()
Hi, I have a graph and I would like to write some values inside the legend that were saved in a variable. Please revise the code below in which I've wrote 2 different legends, but I am not happy with either of them. What I want is a legend with tile "Legend" and underneath a line with a name and a value like that: value = 2. #Code begin: # ------------------- a = 2 # result of a
2007 May 15
1
legend with mixed boxes and lines (not both)
Hi, I seem to be unable to get a mixed legend that has lines *or* polygons (not both). For example: ppi <- seq(0,2*pi,length.out=21)[-21] frame() plot.window(ylim=c(-5,5),xlim=c(-5,5),asp=1) polygon(cos(ppi)*4+rnorm(20,sd=.2),sin(ppi)*4+rnorm(20,sd=.2), col="green",border=FALSE) polygon(cos(ppi)*2+rnorm(20,sd=.1),sin(ppi)*2+rnorm(20,sd=.1), col="blue",border=FALSE)
2007 Sep 25
3
Legend
I have following syntax for putting a legend : legend("bottom", fill=c("red","blue"), legend=expression(p==0.30, p==0.50), bty="n") However what I want is that : the value "0.30" should be a value of a variable instead of a constant, so that I can put the name of this variable and in legend it's value will be displayed. Can anyone tell me how
2006 Oct 26
2
distance between legend title and legend box
Hi, I've looked at the parameters available for the legend function and cannot find a way to change the distance between the top of the box surrounding a legend and the legend's title. I have a math expression that raises the height of my title. If you don't mind the non-sensical title I give to the legend for this plot (Figure 3.20 in R Graphics): with(iris,