similar to: How to plot multiple data sets with different colors (also with legend)?

Displaying 20 results from an estimated 20000 matches similar to: "How to plot multiple data sets with different colors (also with legend)?"

2009 Nov 30
1
Continuous legend colors
Dear List, I am trying to get a basic plot to show a continuous range of fill colors. It is probably easiest to demonstrate. I would like a legend like in the following example: Satellite.Palette <-colorRampPalette(c("blue3","cyan","aquamarine","yellow","orange","red")) require(fields) image.plot(volcano, col = Satellite.Palette
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
2008 Sep 12
2
Again, about boxplot
Thank you for your guys reply for my previous question. But I got one more question about the boxplot. With the code in the R-help: boxplot(len ~ dose, data = ToothGrowth, boxwex = 0.25, at = 1:3 - 0.2, subset = supp == "VC", col = "yellow", main = "Guinea Pigs' Tooth Growth", xlab = "Vitamin C dose mg", ylab =
2008 May 14
1
lw in legend also changes thickness of characters in the legend??
Here's a simple example: x <- 1:5 plot(x,x^2) lines(x,x^2) points(x,x,cex=2) lines(x,x,lw=3) legend("topleft",legend=c("y=x^2","y=x"),pch=1,pt.cex=1:2,lw=c(1,3)) The thickness of the circles in the legend changes with lw. If you change the lw argument in legend to lw=c(1,1) then the thickness of the circles goes back to normal. How can I make the above
2009 May 04
4
levelplot question
Hi there, I have a question concerning the behaviour of the colouring with levelplot. (I hope, I manage to explain) If I give the parameters "at" and "col.regions" like this: at <- c(1,2,3,4,5,6) col.regions <- c("blue","blue","blue","yellow","yellow","yellow") Which color would have the value 3.5? I would
2009 Jul 14
2
hi friends, is there any wait function in R
hi, is there any wait function in R. I am running one R script to plot many graphs it is in the for loop. its showing no error but its not plotting well I think i can solve this problem with a wait function. Please help me in this regards. If u need any clarification about programme. u can find the script below. best regards, Deepak.M.R Biocomputing Group University of Bologana. #!/usr/bin/R
2007 Aug 25
3
fill circles
Hi all, I'm an R newbie, I did this script to create a scatterplot using the "tree" matrix from "datasets" package: library('datasets') with(trees, { plot(Height, Volume, pch=3, xlab="Height", ylab="Volume") symbols(Height, Volume, circles=Girth/12, fg="grey", inches=FALSE, add=FALSE) } ) I'd like to use the column Named
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",
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)
2011 Jul 28
1
color of math annotation in legend
Dear useRs, Can someone help me to adjust the color of math annotation in a legend? The following code gives me a black "alpha = 2". x=y=1:100 z=seq(0.5,50,by=0.5) plot(x,y,type='l',col='black') lines(x,z,col='red') legend('topleft',c(expression(paste(alpha," = ", 1)), expression(paste(alpha," = ",
2008 Sep 05
3
how to draw the legend about color from 3d picture
I have drawed a picture with persp, it's 3d map with different color, indicate different altitude. In gnuplot, the corresponding command 'splot' will generate a picture beside to indicate the relationship between color and altitude. But in R, how to draw it? I have read the manual of legend, but they are all about how to draw a legend with colored text, not a continuous varing color
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 Jul 13
1
Smart legend ???
Hi, all: Is there an automatic smart legend for R? Since my R code is running in a row, which will produce a bunch of R plots in a single run, some of the produced plots are really "ridiculous". Because my legend is fixed to "topleft", sometimes, which occludes the key parts of the figure/plots, but most of the time, the legend works just fine. I'm wondering is there a
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
2005 Jun 28
2
Producing character "given" i.e. "| " with plotmath
Hello! Does someone know how to produce L(y|mu) with plotmath? Some code with unsuccessfull results: plot(dnorm(x = seq(from = -4, to = 4, by = 0.1)), type = "l") ## Not what I want legend(legend = c(expression(L(y:mu))), x = "topright") ## Strange, is this a bug? legend(legend = c(expression(L(y|mu))), x = "top") ## Group produces an error legend(legend =
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
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 Sep 26
2
Changing x-axis on boxplot
Dear List, ? I am creating a boxplot with two subsets, very similar to the example by Roger Bivand at ?boxplot (reproduced below).? I am trying to change the labels on the x-axis to have one number to cover both subsets.? I can do this in other plots by using axis=FALSE followed by a separate axis() command.? I have also tried variations in the names= argument but can't get it to work.?
2009 Apr 10
2
Plot legend
Dear All- I am trying to create a legend where the first 9 terms are represented as pch=16 in one column (which I am able to do); but, I would like the last two terms in that column to be 'lines" (which are black and red - just as it looks like in the plot). I have read through many help pages and searched the help listserv, but haven't figured this one out yet. Does anyone have