[R] how to plot with color according to factor keeping a fixed number of levels?
Luigi Marongiu
m@rong|u@|u|g| @end|ng |rom gm@||@com
Sun Jul 31 17:50:13 CEST 2022
Thank you! It solved it!
On Sun, Jul 31, 2022 at 3:38 PM Ivan Krylov <krylov.r00t using gmail.com> wrote:
>
> On Sun, 31 Jul 2022 15:26:14 +0200
> Luigi Marongiu <marongiu.luigi using gmail.com> wrote:
>
> > but since there is no Y==0, the colors are shifted because Z has only
> > two levels.
>
> You're almost there: you're already making Z a factor. Use factor(Z,
> levels = c(-1, 0, 1)) to make a factor with a predefined range of
> values.
>
> --
> Best regards,
> Ivan
--
Best regards,
Luigi
More information about the R-help
mailing list