Re: [R] legend: interplay between title and y.intersp

2023-03-06 Thread Sigbert Klinke
Hi, that is perfect. Thanks Sigbert Am 06.03.23 um 13:08 schrieb Uwe Ligges: What about  plot(c(0,1), c(0,1), type="n")  legend("top", legend=c("", "a", ""), col=c("blue", "red", "green"), title="test", y.intersp=c(1,-0.4), lwd=1) (in recent versions of R) Best, Uwe -- https://hu.ber

Re: [R] legend: interplay between title and y.intersp

2023-03-06 Thread Uwe Ligges
What about plot(c(0,1), c(0,1), type="n") legend("top", legend=c("", "a", ""), col=c("blue", "red", "green"), title="test", y.intersp=c(1,-0.4), lwd=1) (in recent versions of R) Best, Uwe On 06.03.2023 11:34, Sigbert Klinke wrote: Hi, I think you are right, legend cannot do it.

Re: [R] legend: interplay between title and y.intersp

2023-03-06 Thread Sigbert Klinke
Hi, I think you are right, legend cannot do it. I have now created my own legend function where I changed only one line and now it works the way I want it to. But I'm not sure if that might not have other side effects. I have the impression that the legend and the title start at the same y

Re: [R] legend: interplay between title and y.intersp

2023-03-04 Thread Sigbert Klinke
Hi, thanks, but this does not solve the problem. If I make y.intersp large enough then it works properly. Maybe I was not clear enough: I want to have the small distance between the lines and no overlap between the title and the lines. Sigbert Am 04.03.23 um 17:59 schrieb Bert Gunter: Set

Re: [R] legend: interplay between title and y.intersp

2023-03-04 Thread Bert Gunter
Set the legend position explicitly with x and y values and add xpd = TRUE to the legend call to clip the plot to the figure region and not the plot region (the default). Something like this (you may have to fool around with y.intersp, etc. to allow enough space between the legend lines): plot(c(0,

[R] legend: interplay between title and y.intersp

2023-03-04 Thread Sigbert Klinke
Hi, my MWE is not working as expected: plot(c(0,1), c(0,1), type="n") legend("top", legend=c("", "", "a"), col=c("blue", "red", "green"), title="test", y.intersp=0.2, lwd=1) The lines are not below the title. I want (nearby) lines as in the plot, but below the title. Is there a way to achie

Re: [R] legend in plot

2022-05-06 Thread Naresh Gurbuxani
This is the solution that best fits my needs. Thanks everyone for their responses, Naresh Sent from my iPhone On May 6, 2022, at 2:12 PM, David Carlson mailto:dcarl...@tamu.edu>> wrote: You can't get exactly what you want with base graphics, but you can get close by defining line types and co

Re: [R] legend in plot

2022-05-06 Thread David Carlson via R-help
You can't get exactly what you want with base graphics, but you can get close by defining line types and colors outside the plot command: x <- seq(-3, 3, by = 0.01) lns <- 1:2 clr <- 1:2 matplot(x, cbind(x, x^2), type="l", lty=lns, col=clr) legend("bottomright", legend = c("x", expression(x^2)), l

Re: [R] Legend position in ggplot

2021-06-17 Thread Felipe Carrillo via R-help
Like this? theme(legend.position= 'top' On Thursday, June 17, 2021, 10:52:04 AM PDT, peri He wrote: Dear Friends, I would like to see my legend outside of a ggplot (at the top). This code is showing the legend inside of a plot: theme(legend.position=c(0.15,0.97)) But when I changed

[R] Legend position in ggplot

2021-06-17 Thread peri He
Dear Friends, I would like to see my legend outside of a ggplot (at the top). This code is showing the legend inside of a plot: theme(legend.position=c(0.15,0.97)) But when I changed it to : theme(legend.position=c(-0.15,1.5)) , the legend disappears. I would appreciate it if you share your id

Re: [R] legend order in ggplot2

2018-05-27 Thread Tom Hopper
John, The order of legends in ggplot2 depends on the order of factor levels in the data frame. The linetype can be matched to the factor levels using a named vector (ggplot2 basically does a lookup). The biggest problem you have here is that you’re not passing data in the right form or format

Re: [R] legend order in ggplot2

2018-05-22 Thread PIKAL Petr
eza.cz/01-dovetek/ | This email and any documents attached to it may be confidential and are subject to the legally binding disclaimer: https://www.precheza.cz/en/01-disclaimer/ From: John [mailto:miao...@gmail.com] Sent: Wednesday, May 23, 2018 3:25 AM To: PIKAL Petr Cc: r-help Subject: Re: [R] lege

Re: [R] legend order in ggplot2

2018-05-22 Thread John
ot;solid", "dashed", "dotted", "blank"), > labels=c("name_b","name_a","name_c", "other")) > > Cheers > Petr > > > -Original Message- > > From: R-help [mailto:r-help-boun...@r-project.o

Re: [R] legend order in ggplot2

2018-05-22 Thread PIKAL Petr
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of John > Sent: Tuesday, May 22, 2018 5:17 AM > To: r-help > Subject: [R] legend order in ggplot2 > > Hi, > >I'd like to graph three lines on ggplot2 and I intend the lines to be > "solid

[R] legend order in ggplot2

2018-05-21 Thread John
Hi, I'd like to graph three lines on ggplot2 and I intend the lines to be "solid", "dashed", and "dotted". The legend names are "name_b", "name_a", "name_c". I'd like to legend to present in the order: the "name_b" at the top, and "name_c" at the bottom. As a consequence, the legend is indeed i

Re: [R] legend and values do not match in ggplot

2017-08-04 Thread Jeff Newmiller
Not possible to debug your specific problem without sample data [1][2][3], but learning how to setup and manage factors is a key skill for getting this right. You will also make it less likely that the email you send gets damaged in transit if you send plain text email instead of HTML. [1] htt

[R] legend and values do not match in ggplot

2017-08-04 Thread greg holly
I have following codes for ggplots. The legends are given in the plot do not match with the values specified in the codes given below. Your helps highly appreciated. Greg library(ggplot2) p <- ggplot(a,aes(x=NO_BMI_FI_beta ,y=FI_beta ,color= Super.Pathway))+ theme_bw() +theme(panel.border=ele

Re: [R] legend in ggplot2

2017-02-02 Thread Ivan Calandra
Thanks Thierry, I knew there had to be a simpler way, but just could not find it (facet_wrap() does the trick!). Just 2 other questions: - How do I remove the plot titles? I don't find any argument in facet_wrap() on that... - How can I add the legend for the outliers? Thanks again, Ivan -

Re: [R] legend in ggplot2

2017-02-02 Thread Thierry Onkelinx
Dear Ivan, You're making things too complicated. ggplot(mydata, aes(x = Spot, y = Value)) + geom_boxplot(aes(colour = Equipment), outlier.colour = "red") + geom_jitter() + facet_wrap(~Equipment, scales = "free_y") + scale_colour_manual(values = c(Leeb = "blue", Shore = "red")) Best regar

[R] legend in ggplot2

2017-02-02 Thread Ivan Calandra
Dear useRs, I have been using base graphics since a long time and I'm currently trying to switch to ggplot2. I'm struggling with the legend (which probably means that my graphic commands are not optimal). I have copied the output from dput(mydata) at the end of the email. Here is what I have

Re: [R] legend for vectorplot in rasterVis

2016-03-01 Thread Adrienne Wootten
All, Thanks anyway folks, but I'm going to call myself a bonehead and move on now that I've found it. The key.arrow argument in vectorplot will do what I need to make a scale legend. Thanks all! Adrienne On Tue, Mar 1, 2016 at 9:14 AM, Adrienne Wootten wrote: > Jim, > > Thanks! Interesting

Re: [R] legend for vectorplot in rasterVis

2016-03-01 Thread Adrienne Wootten
Jim, Thanks! Interestingly when working with lengthKey it gives me an error that plot.new hasn't been called after the plot has been created with vectorplot. Really bizarre to me. A On Tue, Mar 1, 2016 at 5:22 AM, Jim Lemon wrote: > Hi Adrienne, > I'm not sure if this will help, but lengthKe

Re: [R] legend for vectorplot in rasterVis

2016-03-01 Thread Jim Lemon
Hi Adrienne, I'm not sure if this will help, but lengthKey in the plotrix package will display a scale showing the relationship of vector length to whatever numeric value is being displayed. However, you do have to sort of the scaling manually. Jim On Tue, Mar 1, 2016 at 7:30 AM, Adrienne Wootte

[R] legend for vectorplot in rasterVis

2016-02-29 Thread Adrienne Wootten
All, Your help with this is greatly appreciated! I'm working with the vectorplot function in rasterVis to produce wind vector maps (pretty much like the code in here - https://rpubs.com/alobo/vectorplot), but I was wondering about a legend. The vectors that vectorplot produces are wonderful. Wh

Re: [R] Legend (guides) for point and two line graph

2014-12-29 Thread Ista Zahn
Hi David, 1) set size to a fixed value instead of mapping it to a constant, i.e., geom_line(size = 2) instead of geom_line(aes(size = 2)) 2) perhaps ggplot(rtest, aes(x=Time, y=Calculated,color=Model, group=Model)) + geom_line(size = 2) + geom_point(aes(y=Observed, shape=""), si

[R] Legend (guides) for point and two line graph

2014-10-13 Thread David Bourne
I’m trying to generate a plot with a series of data points and best fit lines from two stat models. I’m generating the best-fits with another program. I have the data in a csv file as: Time,Observed,Calculated,Model 0.000,0.0,13.0810,1C 0.2500,15.,12.5298,1C 0.5000,12.,12.0018,1C 1.0

Re: [R] legend with math (greek letters) symbols

2014-09-14 Thread William Dunlap
'q' should be an expression object, not a list of expression objects. Try defining 'q' as q <- as.expression(lapply(lambdas, function(l)bquote(lambda==.(l Bill Dunlap TIBCO Software wdunlap tibco.com On Sat, Sep 13, 2014 at 5:55 PM, Julio Sergio Santana wrote: > I need to add a legend w

Re: [R] legend with math (greek letters) symbols

2014-09-13 Thread David Winsemius
On Sep 13, 2014, at 5:55 PM, Julio Sergio Santana wrote: I need to add a legend with three entries that should contain a greek letter (lambda). I learnt that it is possible using the function expression. So I need to build the expressions from the lambdas vector, and I simply cannot do it. This

[R] legend with math (greek letters) symbols

2014-09-13 Thread Julio Sergio Santana
I need to add a legend with three entries that should contain a greek letter (lambda). I learnt that it is possible using the function expression. So I need to build the expressions from the lambdas vector, and I simply cannot do it. This is the uggly result I got: x <- 0:20 cc <- c("yellow

Re: [R] Legend in ggplot2

2014-08-07 Thread Federico Lasa
The problem is that you are not actually 'mapping' any variables to the fill and colour aestethics so ggplot wont produce legends for those. I'm not sure ggplots are appropiate for what you're trying to do here but you can sure hack around it a bit, for instance try: ggplot(tabu, aes(x=weeks, y=T)

[R] Legend in ggplot2

2014-08-07 Thread Pavneet Arora
Hi All Following is my dataset. dput(tabu) structure(list(weeks = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30), values = c(9.45, 7.99, 9.29, 11.66, 12.16, 10.18, 8.04, 11.46, 9.2, 10.34, 9.03, 11.47, 10.51, 9.4, 10.08, 9.37, 10

Re: [R] Legend having lines with different types

2014-05-28 Thread Adams, Jean
IOanna, If you are trying to distinguish between the type="b" and the type="o" in the legend, there does not appear to be a way to do this with the legend() function in base. I found a similar question posted on stackoverflow, and they suggested a work around for something similar (but not quite

Re: [R] Legend having lines with different types

2014-05-28 Thread S Ellison
> I want to plot the legend for the following two lines: > ... > Any ideas how? Try ?legend S Ellison *** This email and any attachments are confidential. Any use...{{dropped:8}} __ R

[R] Legend having lines with different types

2014-05-28 Thread IOANNA
Hello all, I want to plot the legend for the following two lines: I have two lines: X1<-c(0,1,2,3,4) Y1<-c(0,1,2,3,4) Y2<-c(5,6,7,8,9) Y3<-(32,33,34,35,36) plot(X1,Y3,pch=20) lines(X1,Y1,lty=1,type='o') lines(X1,Y2,lty=1,type='b') lines(X1,Y3,lty=2) Any ideas how?

Re: [R] Legend text populated with calculated values and super script?

2014-02-10 Thread Douglas M. Hultstrand
Thanks everyone for the help. Dennis, the bquote version work great. Thanks, Doug On 2/7/2014 7:08 PM, Dennis Murphy wrote: Here's a bquote version: x=c(1,2,3,4); y=c(1,2,3,4); z=c(1.25,1.5,2.5,3.5) # first stats based on data, used to populate legend wdt_n = 50; wdt_mbias = 0.58 wdt_mae = 2

Re: [R] Legend text populated with calculated values and super script?

2014-02-07 Thread Dennis Murphy
Here's a bquote version: x=c(1,2,3,4); y=c(1,2,3,4); z=c(1.25,1.5,2.5,3.5) # first stats based on data, used to populate legend wdt_n = 50; wdt_mbias = 0.58 wdt_mae = 2.1; wdt_R2 = 0.85 # second stats based on data, used to populate legend spas_n = 50; spas_mbias = 0.58 spas_mae = 2.1; spas_R2

Re: [R] Legend text populated with calculated values and super script?

2014-02-07 Thread David Winsemius
On Feb 7, 2014, at 7:54 AM, Douglas M. Hultstrand wrote: > Hello, > > I am trying to generate a plot legend that contains calculated summary > statistics, one statistic is R^2. I have tried several variations using > the commands "expression" and "bqoute" as stated on the R help pages. I >

Re: [R] Legend text populated with calculated values and super script?

2014-02-07 Thread Jim Lemon
On 02/08/2014 02:54 AM, Douglas M. Hultstrand wrote: Hello, I am trying to generate a plot legend that contains calculated summary statistics, one statistic is R^2. I have tried several variations using the commands "expression" and "bqoute" as stated on the R help pages. I have not been able

[R] Legend text populated with calculated values and super script?

2014-02-07 Thread Douglas M. Hultstrand
Hello, I am trying to generate a plot legend that contains calculated summary statistics, one statistic is R^2. I have tried several variations using the commands "expression" and "bqoute" as stated on the R help pages. I have not been able to get the R^2 super script correct along with the

Re: [R] legend position

2013-12-02 Thread philippe massicotte
Thank you David, it is exactly what I needed. Regards,Phil > From: dcarl...@tamu.edu > To: pmassico...@hotmail.com; r-help@r-project.org > Subject: RE: [R] legend position > Date: Mon, 2 Dec 2013 14:29:06 -0600 > > It is not straightforward unless you want the legend in the >

Re: [R] legend position

2013-12-02 Thread David Carlson
mber 2, 2013 1:22 PM To: r-help@r-project.org Subject: [R] legend position Hi all. I'm ploting a raster and I can't find the proper way to move the legend. For example, r = raster(system.file("external/test.grd", package="raster"))plot(r) How can I put the legend

Re: [R] legend position

2013-12-02 Thread philippe massicotte
Thank you, I'll try to work with lattice. Regards,Phil > Date: Mon, 2 Dec 2013 12:06:50 -0800 > From: c...@witthoft.com > To: r-help@r-project.org > Subject: Re: [R] legend position > > It occurs to me that perhaps you're referring to the 'color bar' on the

Re: [R] legend position

2013-12-02 Thread Carl Witthoft
It occurs to me that perhaps you're referring to the 'color bar' on the right of the plot. AFAIK you cannot get at that from the raster::plot method. However lattice::levelplot does allow you to manipulate or remove that colorbar. -- View this message in context: http://r.789695.n4.nabble.

Re: [R] legend position

2013-12-02 Thread philippe massicotte
Thank you for reply. If I'm not wrong, legend(...) will works for discrete elements. I'm not sure hot to use it for a colorbar legend sur as the one in the example bellow. Phil > Date: Mon, 2 Dec 2013 11:49:19 -0800 > From: c...@witthoft.com > To: r-help@r-project.org > S

Re: [R] legend position

2013-12-02 Thread Carl Witthoft
See ?legend . you can add a legend directly to an existing plot. An example: legend('topright',c('hot','cold'),lty=1,col=c('red','green'),bg='white') Now if you're trying to place the legend outside the plot area (i.e. in some other part of the window), you'll need to invoke par(xpd=TRUE) . Se

[R] legend position

2013-12-02 Thread philippe massicotte
Hi all. I'm ploting a raster and I can't find the proper way to move the legend. For example, r = raster(system.file("external/test.grd", package="raster"))plot(r) How can I put the legend at the desired position? Thank in advance,Phil [[alternative HT

Re: [R] legend for bar plot ?

2013-11-26 Thread arun
Hi, May be: barplot(m$V3,names.arg=paste(m$V2,m$V1,sep="\n"),col=rainbow(10)) #or barplot(m$V3,names.arg=m$V2,col=rainbow(20),legend=m$V1, args.legend = list(x = "topright",box.lwd=0,border=FALSE)) A.K. On Tuesday, November 26, 2013 1:18 PM, Adel ESSAFI wrote: Hello; I have the following tab

[R] legend for bar plot ?

2013-11-26 Thread Adel ESSAFI
Hello; I have the following table > m V2 V1 V3 1 C/L 0 732179 3 C/S 0 803926 19 D/F 0 724924 17 D/I 0 755841 13 D/L 0 731904 15 D/S 0 798289 11 I/F 0 871670 9 I/I 0 897718 5 I/L 0 2628113 7 I/S 0 2628113 2 C/L 1 1107269 4 C/S 1 1395714 20 D/F 1 1181282 18 D/I 1

[R] legend for bar plot ?

2013-11-26 Thread Adel ESSAFI
Hello; I have the following table > m V2 V1 V3 1 C/L 0 732179 3 C/S 0 803926 19 D/F 0 724924 17 D/I 0 755841 13 D/L 0 731904 15 D/S 0 798289 11 I/F 0 871670 9 I/I 0 897718 5 I/L 0 2628113 7 I/S 0 2628113 2 C/L 1 1107269 4 C/S 1 1395714 20 D/F 1 1181282 18 D/I 1

Re: [R] legend for the plot with type = "b"

2013-09-23 Thread Jinsong Zhao
On 2013/9/23 12:52, David Winsemius wrote: On Sep 22, 2013, at 10:54 PM, Jinsong Zhao wrote: Hi there, I plot a simple plot with the following code: plot (rnorm(1:10), type = "b") legend("top", "test", lty = 1, pch = 21) ?par plot (rnorm(1:10), type = "b") legend("top", "test", lty = "69",

Re: [R] legend for the plot with type = "b"

2013-09-23 Thread Jinsong Zhao
On 2013/9/23 17:11, Jim Lemon wrote: On 09/23/2013 01:54 PM, Jinsong Zhao wrote: Hi there, I plot a simple plot with the following code: plot (rnorm(1:10), type = "b") legend("top", "test", lty = 1, pch = 21) The result is something wired for the line crosses the point in the legend while the

Re: [R] legend for the plot with type = "b"

2013-09-23 Thread Jim Lemon
On 09/23/2013 01:54 PM, Jinsong Zhao wrote: Hi there, I plot a simple plot with the following code: plot (rnorm(1:10), type = "b") legend("top", "test", lty = 1, pch = 21) The result is something wired for the line crosses the point in the legend while the line does not cross the point in the

Re: [R] legend for the plot with type = "b"

2013-09-22 Thread David Winsemius
On Sep 22, 2013, at 10:54 PM, Jinsong Zhao wrote: Hi there, I plot a simple plot with the following code: plot (rnorm(1:10), type = "b") legend("top", "test", lty = 1, pch = 21) ?par plot (rnorm(1:10), type = "b") legend("top", "test", lty = "69", pch = 21) The result is something wired

Re: [R] legend for the plot with type = "b"

2013-09-22 Thread arun
t;)  legend1<- legend("top","test",lty=1,pch=21) A.K. - Original Message ----- From: Jinsong Zhao To: R help Cc: Sent: Sunday, September 22, 2013 11:54 PM Subject: [R] legend for the plot with type = "b" Hi there, I plot a simple plot with the followin

[R] legend for the plot with type = "b"

2013-09-22 Thread Jinsong Zhao
Hi there, I plot a simple plot with the following code: plot (rnorm(1:10), type = "b") legend("top", "test", lty = 1, pch = 21) The result is something wired for the line crosses the point in the legend while the line does not cross the point in the main plot. Is there possibility to draw th

Re: [R] Legend Help

2013-09-03 Thread PIKAL Petr
ano > Sent: Tuesday, September 03, 2013 10:59 AM > To: r-help@r-project.org > Subject: [R] Legend Help > > Hi to everyone and thanks for this service. > > I have a doubt with legend, I have seen ?legend, but I don't get the > way to write in my code the > > legen

[R] Legend Help

2013-09-03 Thread Mª Teresa Martinez Soriano
Hi to everyone and thanks for this service. I have a doubt with legend, I have seen ?legend, but I don't get the way to write in my code the legend that I want, This is my code: for( i in 1:4)} pdf(paste("plotImputed", i,".pdf",sep="")) plot(a[,6], type="l", main=paste( "I

[R] Legend position

2013-09-02 Thread Moshiur Rahman
Dear R-helpers, I'm trying to combine two box plots having two dependent variables: var1- Orange.area and var2- Iridescent.area; two independent categorical factors (each has two levels - 'High' & 'Low'): fact1- Quantity fact2- Quality the data frame (df) is: Quantity Quality Orange.are

Re: [R] Legend formatting (ggplot2)

2013-08-28 Thread Ista Zahn
Hi Robert, Your legend is for fill, not color, so you need guides(fill = guide_legend(nrow = 3)) instead of guides(colour = guide_legend(nrow = 3)) Best, Ista On Wed, Aug 28, 2013 at 5:09 PM, Robert Lynch wrote: > I am having trouble getting my legend to format the way I want it to. I > sus

Re: [R] Legend formatting (ggplot2)

2013-08-28 Thread Robert Lynch
I am having trouble getting my legend to format the way I want it to. I suspect it is something simple. > > the code I have is > library(ggplot2) > ggplot(Chem.comp, aes(Course, GRADE.)) + geom_boxplot(notch = > TRUE,aes(fill = COHORT))+ > labs(title = "Comparison between ISE cohorts and Peers

[R] legend in ggmap

2013-07-29 Thread Edoardo Baldoni
Hello, how can I visualize the legend in the following ggmap plot ? In the legend I just want to show the size ranges of the data: ggmap(map) + geom_point(aes(x=Longitude,y=Latitude), size = dataRd[,2]/12, col=2, data=dataRd, alpha=0.7, lwd=2) Thanks Edoardo [[alternative HTML version

Re: [R] legend issues.

2013-02-26 Thread Nicole Ford
I thought my reply went to the group last night. i had already resolved it. in short, before his first reply it was resolved... which is why i didn't offer additional information. i was honestly taken aback by his response to me. i don't respond well to vitriol wrapped in attempts to help. i

Re: [R] legend issues.

2013-02-26 Thread Greg Snow
Nicole, Since you seem more interested in accusing David of being rude than recognizing your own rudeness and taking steps to overcome that and increase your chance of getting useful responses I will quote a few lines from the posting guide for you (the entire posting guide is available from the l

Re: [R] legend issues.

2013-02-25 Thread Nicole Ford
by the time your rude reply came ( you are often rude to people so i shouldn't have been surprised but somehow was) , i had already found my answer, by doing it MYSELF on her computer and found had not followed some simple instructions. be well. ~Nicole Ford Ph.D. student Graduate Assistant/ In

Re: [R] legend issues.

2013-02-25 Thread Nicole Ford
I did look at ??pie ??graphics, as per my reply. which netted nothing of value. thanks. ~Nicole Ford Ph.D. student Graduate Assistant/ Instructor University of South Florida Government and International Affairs office: SOC 012M e: nmhi...@mail.usf.edu http://gia.usf.edu/student/nford/ On

Re: [R] legend issues.

2013-02-25 Thread David Winsemius
My point is that you _still_ have not adhered to the Posting Guide request for sessionInfo() ... I say again. Please read the Posting Guide ... AND PLEASE STOP posting formatted email. -- David. On Feb 25, 2013, at 10:20 AM, Nicole Ford wrote: > I did look at ??pie ??graphics, as per my repl

Re: [R] legend issues.

2013-02-25 Thread David Winsemius
On Feb 25, 2013, at 7:37 AM, Nicole Ford wrote: > hello, all. > > one of my students is having an issue with the pie & legend function. > > this is her code. (below) > > it works just fine for me. > > her error is "plot.new has not been called yet". i know this means her pie > chart is com

[R] legend issues.

2013-02-25 Thread Nicole Ford
hello, all. one of my students is having an issue with the pie & legend function. this is her code. (below) it works just fine for me. her error is "plot.new has not been called yet". i know this means her pie chart is coming up blank so the legend will not work. according to ?graphics thi

Re: [R] Legend symbols

2012-12-21 Thread Greg Snow
Using pch you can use all the symbols in the current font, try: plot(0:15, 0:15, type='n') points( (0:255)%%16, (0:255)%/%16, pch=0:255 ) then do it again with points( (0:255)%%16, (0:255)%/%16, pch=0:255, font=5 ) (font 5 is usually a symbol font, fonts 2, 3, and 4 are bold and italic versions

[R] Legend symbols

2012-12-21 Thread Diviya Smith
Hi there, I was wondering if there is any R package that one can use for plotting that has more legend symbols - the standard pch has 18 symbols but I need ~30 for my application- and just using different colors is not an option. Thank you in advance, Diviya [[alternative HTML version de

Re: [R] FW: Two-line title in R legend

2012-11-12 Thread David Winsemius
he title as two lines, but the top line is outside the legend box. > > How can I trick the R legend function to make the legend box taller so that > it contains the top line? > You should include an example with dummy data if you wnat tested solutions. You can try: lege

Re: [R] FW: Two-line title in R legend

2012-11-11 Thread David L Carlson
- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Gabriel Toro &g

[R] FW: Two-line title in R legend

2012-11-11 Thread Gabriel Toro
Hi, I am trying to use a legend title that is a bit too long for one line. To try to break the title in two lines, I am using legend (title="Top of Title\nbottom of title", etc. ) R prints the title as two lines, but the top line is outside the legend box. How can I trick th

Re: [R] legend of maps generated by function symbols

2012-10-18 Thread Greg Snow
Possible? Yes. (see fortune("Yoda")) Automated using the legend function? No Automated using another function? possbly somewhere in the 4,000+ packages on CRAN, but I don't know which. It is doable with the basic tools. You could either find a part of your graph with open area to put the legend i

[R] legend of maps generated by function symbols

2012-10-18 Thread Marion Jacquot
I generated maps with the function symbols (graphics). These are basic maps generated with : symbols(x,y,circles=myvariable) where x et y are spatial coordinates corresponding to replicates of "myvariable". I would associate legend to this kind of maps, is it possible? Regards, Marion. --

Re: [R] Legend Truncated Using filled.contour

2012-10-09 Thread Kirsten Simmons
This worked perfectly, thank you! (Sorry for the delay, was traveling and didn't get a chance to test it until now.) Kirsten On Oct 4, 2012, at 1:30 PM, David Winsemius wrote: > > On Oct 3, 2012, at 12:58 PM, Kirsten wrote: > >> Hey everyone, >> >> I'm working on a contour plot depicting a

Re: [R] Legend Truncated Using filled.contour

2012-10-04 Thread David Winsemius
On Oct 3, 2012, at 12:58 PM, Kirsten wrote: > Hey everyone, > > I'm working on a contour plot depicting asymptomatic prevalence at varying > durations of infectiousness and force of infection. I've been able to work > everything out except for this one - my legend title keeps getting cut off.

Re: [R] Legend Truncated Using filled.contour

2012-10-03 Thread K Simmons
Data attached - didn't realize I could do that last night. Here's the data inport piece of my code, change the pathname to your computer. asym<-read.csv('/Users/kirstensimmons/Desktop/Asym04.csv') asym #put the data into a data matrix asym_matrix<-data.matrix(asym) On Thu, Oct 4, 2012 at 6:35

Re: [R] Legend Truncated Using filled.contour

2012-10-03 Thread David Winsemius
On Oct 3, 2012, at 12:58 PM, Kirsten wrote: > Hey everyone, > > I'm working on a contour plot depicting asymptomatic prevalence at varying > durations of infectiousness and force of infection. I've been able to work > everything out except for this one - my legend title keeps getting cut off.

[R] Legend Truncated Using filled.contour

2012-10-03 Thread Kirsten
Hey everyone, I'm working on a contour plot depicting asymptomatic prevalence at varying durations of infectiousness and force of infection. I've been able to work everything out except for this one - my legend title keeps getting cut off. Here's what I have: filled.contour(x=seq(2,30,length.ou

Re: [R] legend position help

2012-08-16 Thread Greg Snow
A quick hack to give you space between the line and point (if you only used solid lines) is to specify lty='ff' to the legend function. If you want more control then look at setting trace=TRUE and plot=FALSE and looking at the printed outcome and the return value from legend. This does not plot t

Re: [R] legend position help

2012-08-15 Thread Jinsong Zhao
On 2012-08-16 0:22, Greg Snow wrote: You can use the grconvertY function to find the position in the current user coordinates that corresponds to the top of the device area (instead of using locator). Thank you very much. grconvertX() and grconvertY() work very well. Look at the "merge" argu

Re: [R] legend position help

2012-08-15 Thread Greg Snow
You can use the grconvertY function to find the position in the current user coordinates that corresponds to the top of the device area (instead of using locator). Look at the "merge" argument to the legend function. On Wed, Aug 15, 2012 at 10:04 AM, Jinsong Zhao wrote: > Hi there, > > I draw a

[R] legend position help

2012-08-15 Thread Jinsong Zhao
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(

Re: [R] Legend: Custom distance between lines and text

2012-06-09 Thread Sebastian Schubert
On 09/06/12 13:20, peter dalgaard wrote: >> I guess I overlook the corresponding part in the manual but how can I >> modify the distance between the text and the line in a legend? >> >> Thank you for any hints! > > You mean like this? > > plot(0) > legend(1, .5, legend=c("foo","bar"), lty=1:2, pc

Re: [R] Legend: Custom distance between lines and text

2012-06-09 Thread peter dalgaard
On Jun 9, 2012, at 13:04 , Sebastian Schubert wrote: > Hi, > > I guess I overlook the corresponding part in the manual but how can I > modify the distance between the text and the line in a legend? > > Thank you for any hints! You mean like this? plot(0) legend(1, .5, legend=c("foo","bar"), l

[R] Legend: Custom distance between lines and text

2012-06-09 Thread Sebastian Schubert
Hi, I guess I overlook the corresponding part in the manual but how can I modify the distance between the text and the line in a legend? Thank you for any hints! Sebastian signature.asc Description: OpenPGP digital signature __ R-help@r-project.org

Re: [R] Legend colors not matching with Intxplot line colors

2012-06-03 Thread arun
Hi Richard, Thanks for the solution. A.K. From: Richard M. Heiberger To: arun Sent: Monday, June 4, 2012 1:47 AM Subject: Re: [R] Legend colors not matching with Intxplot line colors Thank you for catching that.  I will repair it in the next version of

[R] Legend colors not matching with Intxplot line colors

2012-06-03 Thread arun
Dear R help, I am using intxplot() from the library(HH).  I have a dataset with 12 treatment groups.  At first, I tried intxplot with no color settings.  Then, the legend color was matching with the plot line colors, but some of the colors were repeated.  So, I set the colors using par.settings

Re: [R] Legend based on levels of a variable

2012-04-06 Thread Kumar Mainali
Thank you every body for your suggestion. It does help. On Fri, Apr 6, 2012 at 2:37 AM, windmagics_lsl wrote: > I think there may 3 legends should be added in your plot > the argument col, pch and pt.cex should be in the same length with legend, > but the objects col, pch > and cex you defined

Re: [R] Legend based on levels of a variable

2012-04-06 Thread windmagics_lsl
I think there may 3 legends should be added in your plot the argument col, pch and pt.cex should be in the same length with legend, but the objects col, pch and cex you defined former have 16*3 length. I guess the follow codes may work col <- rep(c("blue", "red", "darkgreen"), c(16, 16, 16)) ##

Re: [R] Legend based on levels of a variable

2012-04-06 Thread Petr PIKAL
Thanks, anyway, using build-in R features is preferable for colours with(data, plot(axis1, axis2, col= c("red", "blue", "green")[as.numeric(data$Region)])) legend("topright", legend=levels(data$Region), fill= c("red", "blue", "green")) although sometimes can be preferable to get advantage of

Re: [R] Legend based on levels of a variable

2012-04-06 Thread mlell08
He provided data, yet in an inconvenient way at the bottom of his post. Kumar, please use dput() to provide data to the list, because its much easier to import: dput(data)## name data is made up by me structure(list(Region = structure(c(2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 1L, 1L, 1L, 1L,

Re: [R] Legend based on levels of a variable

2012-04-06 Thread Petr PIKAL
Hi > > I have a bivariate plot of axis2 against axis1 (data below). I would like > to use different size, type and color for points in the plot for the point > coming from different region. For some reasons, I cannot get it done. Below > is my code. > > col <- rep(c("blue", "red", "darkgreen"

[R] Legend based on levels of a variable

2012-04-05 Thread Kumar Mainali
I have a bivariate plot of axis2 against axis1 (data below). I would like to use different size, type and color for points in the plot for the point coming from different region. For some reasons, I cannot get it done. Below is my code. col <- rep(c("blue", "red", "darkgreen"), c(16, 16, 16)) ## C

Re: [R] legend

2012-03-08 Thread Chintanu
Thanks - Jason Connor, Rolf Turner and Pascal Oettli. Either of the following can remove the border surrounding the words. legend (locator(1), "Important ones", box.col=NA) legend (locator(1), " Important ones ", bty="n") regards, Chintanu [[alternative HTML version deleted]] _

Re: [R] legend

2012-03-08 Thread Rolf Turner
On 08/03/12 18:52, Chintanu wrote: Hi, A very simple thing that I'm unable to do. I did look at the help but While putting a legend on a plot, I don't wish to have the enclosing border surrounding the words (as given below). Tried to use the following, but didn't help : legend (locator(

[R] legend

2012-03-07 Thread Chintanu
Hi, A very simple thing that I'm unable to do. I did look at the help but While putting a legend on a plot, I don't wish to have the enclosing border surrounding the words (as given below). Tried to use the following, but didn't help : legend (locator(1), border=FALSE, fill=FALSE, "Import

Re: [R] Legend vanishes when placed outside the graph

2012-02-16 Thread David Winsemius
On Feb 16, 2012, at 6:50 AM, David Zastrau wrote: Hello everyone, i’ve got a problem with my diagram’s legend. I know i should be able to figure it out by reading the ‘plot’ and ‘legend’ reference. However nothing works so it would be kind if anyone could point me to the necessary parame

Re: [R] Legend vanishes when placed outside the graph

2012-02-16 Thread David Zastrau
I figured it out: you have to pass the mar-argument to the plot function and than you may position the legend via inset. Have a nice day! From: David Zastrau Sent: Thursday, February 16, 2012 12:50 PM To: r-help@R-project.org Subject: Legend vanishes when placed outside the graph Hello ever

  1   2   3   4   >