similar to: Producing a legend successfullly

Displaying 20 results from an estimated 20000 matches similar to: "Producing a legend successfullly"

2009 Aug 25
3
math symbol + value of a variable in legend.
Hi R users: I will like to have a legend with math symbols and also with the value of a variable. But I cannot obtain both at the same time (symbol + value of a variable): Here is a reproducible example: m1<-5 m2<-12 plot(1:5,1:5,type="n") legend("topleft",legend=c(paste(expression(mu),"=",m1),expression(paste(mu,"=",m2))),lty=1:2) Thank you for
2009 Aug 25
3
math symbol + value of a variable in legend.
Hi R users: I will like to have a legend with math symbols and also with the value of a variable. But I cannot obtain both at the same time (symbol + value of a variable): Here is a reproducible example: m1<-5 m2<-12 plot(1:5,1:5,type="n") legend("topleft",legend=c(paste(expression(mu),"=",m1),expression(paste(mu,"=",m2))),lty=1:2) Thank you for
2011 Apr 29
3
Change the text size of the title in a legend of a R plot.
Hello, Is it possible to change the text size of the title in a legend of a R plot? I tried to directly change the title.cex argument but it seems not to work. Trying : Horizo <- c(1,2,6,10,20) legtext <- paste(Horizo,sep="") legend("topleft", legend=legtext,col=col,text.col=col,lwd=lwd, lty=lty,cex=1.1,ncol=3,title = "Horizons",title.col
2010 Jul 22
5
legend in R plot
Hi all, I am have some difficulty with the legend function. I need to add a legend to describe the different line types in a plot. The legend box is small. It did not include sufficient length of each line type to help distinguish the differnt line types. Is there a way to fix this. Thank you Hannah [[alternative HTML version deleted]]
2006 Mar 10
2
Plot.date and legends
Hi: I'm trying to plot dates on the x-axis of a code, but the legend is not being displayed. I receive the following error: Error in match.arg(x, c("bottomright", "bottom", "bottomleft", "left", : 'arg' should be one of bottomright, bottom, bottomleft, left, topleft, top, topright, right, center In addition: Warning message: longer
2011 Feb 10
1
Add different types of legend: line and points
Hello, I plot box plot, and add a point to the box indicating mean. I also add some range to the box width. I want to add legend for both the range (line) and mean (point). However, I cannot add line legend and point legend together. The code looks like the following. (1) First, I tried the following code, however, it plot a line across the point legend("*"). boxplot(count ~ spray,
2009 Sep 25
2
Letra cursiva en legend()
Buenas tardes para todos, Consideren la siguiente gráfica: # Algunos datos set.seed(123) D <- matrix(rnorm(100), ncol = 2) # Gráfico matplot(D, type = ''l'', lty = 1, col = c(3,4), las = 1, xlab = "Observación", ylab = ''Valores'') # Leyenda legend(''topleft'', c(''A1'',''A2''), text.col =
2010 Feb 04
3
Legend symbol?
Hello, I am creating a plot/image using different data and a couple fit lines (see attached image). In the legend, I want the Default and Exponential symbol to be a line. I am using the pch command, I tried to use "-" to represent a line but does not work so I currently have set as a "1". Any thoughts or suggestions would be greatly appreciated. Below are the commands
2009 Jan 14
4
How to get legend outside of plot?
I am creating a CDF plot function more user-friendly than any default r function. Depending upon the bimodality of the data (it is often bimodal), or any other strange data trends, the points can end up gathering in just about any corner of the plot. So, when I add a legend, whether I choose to add it in the bottom right, top left, or wherever, it will sometimes end up putting the legend right
2012 Jan 19
1
Legend problem in line charts
Hi all, Small problem in generating the line charts. Question: Legend for the first graph is coming wrong., for second graph correctly. Please fix the legend postion at the down of graph. Plesae give me the solution. Thank you Devarayalu Orange1 <- structure(list(REFID = c(7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9), ARM = c(1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2,
2012 Feb 22
1
line width in legend of interaction.plot
Dear R developers, The following command produces an interaction plot with lwd=2. interaction.plot(c(1, 2, 1, 2), c(1, 1, 2, 2), 1:4, lwd=2) In the legend, however, lwd seems to be 1, which does not seem to be intended behavior. Probably the lwd is not correctly forwarded to legend: from the interaction.plot source: legend(xleg, yleg, legend = ylabs, col = col, pch = if (type %in%
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)
2008 Jan 19
1
show overstruck in plot legend
Hi, I have a plot with type="o", or overstruck. Now I am trying to add the legend, but I couldn't figure out how to show the overstruck type in the legend. It seems that the legend only allows one to set lty. Does anyone know how to show overstruck in the legend? Thanks! -- Tom [[alternative HTML version deleted]]
2011 Sep 20
3
Problem with legend
HI, This code is part of a code I used to do a linear regression: >points(var1~var2,data=Regress,pch=21,bg="grey") >reg11<-lm(var1~var2,data=Regress) >abline(lm(var1~var2,data=Regress),lty=2,lwd=2,col="grey") >legend("topleft",legend= >c("NDII from composite", >"y= 0.0007x - 0.1156",expression(paste(r^2 ==
2008 Sep 30
1
Adding legends to a plot
Hello, I have a time series plot drawn using 3 different colored lines, each line corresponds to different category group. I'd like to put legends on the plot. I am using "legend" to do this, however, I can either specify lty or col in legend. Will I be able to do the following in the legend box: a solid black line then g1, a solid red line then g2, a solid blue line then g3?
2008 Jul 29
4
Graphics function question
Hello I have created a graph using the following commands: <<< startBReP3O1T <- diffs$BReP3O1T - diffs$diff_BReP3O1T endBReP3O1T <- diffs$BReP3O1T x <- seq(47,89, length = 10) ymin <- min(min(startBReP3O1T), min(endBReP3O1T)) ymax <- max(max(startBReP3O1T), max(endBReP3O1T)) y <- seq(ymin, ymax, length = 10) plot(x,y, type = 'n', xlab = 'Age', ylab =
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
2002 Jun 05
6
mixing different modes of lty line type specification in legend() ?
Hi List, is sth. like the following possible: legend(x,y,c("A","B","C"), lty=list(1,"42","11")) ? Or: is there a possibility to define a solid line using the "string" mode for lty? Thanks Marcus -- +-------- ><> ------------------------------------------- | E-Mail: eger.m at gmx.de (NEW) | marcus.eger at
2005 Mar 14
1
Legend Line Size
Hello all, When I view or print the below plot on my Linux machine under R 2.0.1 I see a nice thick solid and dashed line with a legend. However, while the lines are distinguishable, the legend is not. That is, the short (solid) line next to "line1" and the short (dashed) line next to "line2" seem to have the exact same length. What I would like to do is to expand the legend
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