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

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
uld like the additionally differentiate the two lines (groups) in the linetype. Sibylle -Original Message- From: Jeff Newmiller Sent: Thursday, July 18, 2024 6:13 PM To: sibylle.stoec...@gmx.ch; SIBYLLE STÖCKLI via R-help ; r-help@r-project.org Subject: Re: [R] ggplot two-factor

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