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
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
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
> 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
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
5 matches
Mail list logo