Re: [R] ggplot two-factor legend

2024-07-18 Thread SIBYLLE STÖCKLI via R-help
Thanks a lot Rui and Jeff Yes including labels=c() in scale_linetype_manual() was the hint. Sibylle -Original Message- From: Rui Barradas Sent: Thursday, July 18, 2024 6:50 PM To: sibylle.stoec...@gmx.ch; r-help@r-project.org Subject: Re: [R] ggplot two-factor legend Às 17:43 de 18/0

Re: [R] ggplot two-factor legend

2024-07-18 Thread Rui Barradas
Às 17:43 de 18/07/2024, Rui Barradas escreveu: Às 16:27 de 18/07/2024, SIBYLLE STÖCKLI via R-help escreveu: Hi I am using ggplot to visualise y for a two-factorial group (Bio: 0 and 1) x = 6 years. I was able to adapt the colour of the lines (green and red) and the linetype (solid and dashed

Re: [R] ggplot two-factor legend

2024-07-18 Thread Rui Barradas
Às 16:27 de 18/07/2024, SIBYLLE STÖCKLI via R-help escreveu: Hi I am using ggplot to visualise y for a two-factorial group (Bio: 0 and 1) x = 6 years. I was able to adapt the colour of the lines (green and red) and the linetype (solid and dashed). Challenge: my code produces now two legends. One

Re: [R] ggplot two-factor legend

2024-07-18 Thread SIBYLLE STÖCKLI via R-help
Thanks Jeff I removed the group parameter in the fp1<-ggplot () line. It doesn't change anything. I suppose I got two legends as in the ggplot () line I have color=Bio & linetype=Bio. However, when removing linetype = Bio I just geht red and green. For black and white printing I would like the

Re: [R] ggplot two-factor legend

2024-07-18 Thread Jeff Newmiller via R-help
If I follow your question, you want redundant aesthetics. Ggplot normally notices correlated aesthetic mapping variables and merges the legends, so the most likely answer is that your data are not fully correlated in all rows. I have also seen this where data are drawn from different dataframes

[R] ggplot two-factor legend

2024-07-18 Thread SIBYLLE STÖCKLI via R-help
Hi I am using ggplot to visualise y for a two-factorial group (Bio: 0 and 1) x = 6 years. I was able to adapt the colour of the lines (green and red) and the linetype (solid and dashed). Challenge: my code produces now two legends. One with the colors for the group and one with the linetype for th