similar to: Plotting (mixed) line types and legends

Displaying 20 results from an estimated 20000 matches similar to: "Plotting (mixed) line types and legends"

2007 Nov 08
1
Mixing lty specifications in legend
Hi all I have a plot with lines, one specified as (say) lty=1, using standard line types, and another as (say) my own spec: lty="51". I can't get legend to display both. Toy example: > plot(1~1) > legend("topright", lty=c("51",1), legend=c("My own","Standard")) Error in segments(x1, y1, x2, y2, ...) : invalid line type: must be
2006 Sep 22
1
legends in a plot
Hi there, I have the following plot. The circles and the line do not cross in the main plot. But in the legend, the circle and the line cross. I am wondering if there is a way to make the legend look like the plot without crossing. I looked around but did not find a way to do that. Is it doable? plot(x,x^1.5, pch=1, lty=1, type='b') legend(1,25, legend="hello",pch=1,
2009 Jun 06
1
correct line types in lattice legends
Hallo R-users, I do not understand how to specify the correct line and symbol types in the legends of a lattice xyplot. This is what I tried, but the line types and symbol in the graph are not seen in the legend. Any help is appreciated. Thanks, Gerrit. library(lattice) s<-rep(1:3,len=10) x<- 1:10 y<- x+s+rnorm(10) d<-data.frame(s,x,y) xyplot(y~x, groups=s,data=d,
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
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?
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,
2013 Jan 26
2
different legends in lattice panels
Hi listers, I want to make lattice plots xyplots with the indication of legends inside each panel with only the points and the lines actually ploted inside each given panel according to the group(ing) factor. The code below shows what I have achieved so far and I hope will make clear what I want to have. It seems to me that my solution is a very "dirty hack" and there certainly is
2003 Jun 05
2
Fwd: Re: legend() with option adj=1
Is there a simpler way then the solution to the one that was posted here? I'm not very proficient with legend, and I don't understand this solution. All I have is two or more lines on one plot that I want to put a legend on and I can't figure out how to do it from the examples. Can you give a very simple example? It does not have to be fancy!! I have never worked with a
2007 Sep 10
3
plot legend: combining filled boxes and lines
Hello, I have difficulties combining boxes and lines in plot legend. I searched previous R-posts and found this (with no solution): http://tolstoy.newcastle.edu.au/R/help/06/07/30248.html. Is there a way to avoid boxes behind the line legends? x1 <- rnorm(100) x2 <- rnorm(100, 2) hist(x1, main = "", col = "orange",ylab = "density", xlab = "x", freq =
2006 Apr 18
4
how to change legend size in a figure
Dear All, I am producing a figure with many curves on it. How do I make the legends for all those curves smaller so that it can fit the figure itself? The commands I used for ploting are: plot(x1,y1,col=1,lty=1) lines(x2,y2,col=2,lty=2) ... legend(0.3,0.4,c("name1","name2",...),col=1:20,lty=1:20) Any tips for making the legend fit the figure will very welcome! Thanks! Best,
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
2003 Jul 29
1
Sweave: pass scale parameter to includegraphics?
Hi all I'm using Sweave and find it a treat. But one question: I use Sweave to create my pictures which are automatically included into LaTeX. For example, in the file test.Snw, I may have: % LaTeX stuff \begin{figure} <<fig=true,width=5,height=5>>= x1 <- seq(1,5, length=10) x2 <- sin(x1) plot(x1,x2) @ \caption{Plot} \end{figure} % More LaTeX This produces the LaTeX
2010 Feb 03
1
legend help
i=1 for(rate in c(2,4) ){ for(shape in c(1,3,5) ){ curve(dgamma(x,rate,shape),xlim=c(0,3),ylab="",col=i,lty=i,add=T) i=i+1 } } How can I add some legend to represent these lines? i.e. the legend is displayed as col=1 lty=1 lambda=2 theta=1 col=2 lty=2 lambda=2 theta=3 col=3 lty=3 lambda=2 theta=5 col=4 lty=4 lambda=4 theta=1 col=5 lty=5 lambda=4 theta=3 col=6 lty=6 lambda=4 theta=5
2009 Jan 08
1
legend() in a multiple figure environment
Dear all, there seems to be a problem with displayed legends when a multiple figure environment is used, see the following example: par(mfrow=c(1,2)) curve(dnorm,col=4,from=-4,to=4); legend(-4,0.3,legend="curve",lty=1,col=4) legend(-4,0.2,legend="curve",lty=1,col=4) On my machines the first time the command legend() is issued the legend box stretches over the curve.
2003 Mar 21
1
The best way to end up with TIFF {Was: end up with WMF)
Hi all I posted a couple of days ago about how to end up with wmf files eventually in R for linux. The short answer was: you (probably) can't...and don't! The journal in question also accepts TIFF files, I am told (it's a physiology journal). So I adjust my question: What is the best way to get TIFF files out of R? It can't create them directly as far as I can tell.
2004 Mar 29
1
White background in PS pictures
Hi all I am using R to produce postscript pictures via the postscript command. I have never had any problems... until now, when I want to inlcude my .ps file is a LaTeX document *without* a white background. (If it's important, I'm using the prosper class with the whitecross option, so the background in blue.) I would like my .ps file to have a white background. If I read the help
2006 May 10
2
Legend titles in log plots broken? (ver. 2.2.1)
Legend titles work in linear plots: curve(1/x, xlim = c(0, 1)) legend(x = 'topright', inset = 0.04, legend = '1/x', lty = 1, title = 'Legend Title') But when you change to a log plot on either dimension things get screwy: curve(1/x, xlim = c(0, 1), log = 'y') legend(x = 'topright', inset = 0.04, legend = '1/x', lty = 1,
2004 Nov 11
1
substitute/paste question for using Greek in plot titles
Hi all I am having troubles making sense of why code (1) below fails but code (2) below works. Code (1): > phi.1 <- 1 > plot(0 ~ 0, + main=substitute(paste("A vaue for ",phi," = ",phival), list(phival=phi.1)) ) Error in paste("The two deviances for ", phi, " = ", 2) : Object "phi" not found But this works: Code (2): >
2003 Apr 02
2
Two questions
Hi all Two questions: 1. I note that help for the postscript device claims "The postscript produced by R is EPS (Encapsulated PostScript) compatible...". It does not say it is EPS *compliant*. Indeed, the EPS produced by R includes a \showpage command which I believe (not that I'm an expert!) non-standard EPS. My question: Is there any reason why it is EPS compatible, but
2005 Mar 17
1
Legend positioning in scaled survival plot
I am sorry that this is another novice question. I am having trouble using "legend" with the survival curve plot from the survival package, and I wonder if it is because I have rescaled my plot. Here is the relevant segment of code: > plot(survfit(Surv(OS,Status)~shortishcr1),main='Overall Survival by factor', + xlab='Years',ylab='%