[R] [External] Missing text in lattice key legend

Richard M. Heiberger rmh @end|ng |rom temp|e@edu
Mon Oct 11 16:22:25 CEST 2021


looks like a paren outof place.  the text is inside the points. it should be parallel to the points in the calling sequence.

Get Outlook for iOS<https://aka.ms/o0ukef>
________________________________
From: R-help <r-help-bounces using r-project.org> on behalf of Luigi Marongiu <marongiu.luigi using gmail.com>
Sent: Monday, October 11, 2021 7:46:36 AM
To: r-help <r-help using r-project.org>
Subject: [External] [R] Missing text in lattice key legend

Hello,
I am drawing some data with lattice using:
```
library(lattice)
COLS = c("gold", "forestgreen", "darkslategray3", "purple")
xyplot(Value ~ Concentration,
       group = Substance, data = inf_avg,
       pch = 16, cex = 1.2, type = "b",
       xlab=expression(bold(paste("Concentration (", mu, "M)"))),
       ylab=expression(bold("Infection rate")),
       col=COLS,
       scales = list(x = list(log = 10, at=c(unique(inf_avg$Concentration))
                              )
                     ),
       key = list(space="top", columns=4, col = "black",
                       points=list(pch=c(16, 16, 16, 16),
                                   col=COLS,
                                   text=list(c("6-PN", "8-PN", "IX", "XN")
                                            )
                                   )
                  ),
       panel = function(x,y) {
         panel.xyplot(x,y)
         errbar()
       }
)
```
It all works but the legend only shows the colored dots, there is no
text. Is it something missing from the syntax?
Thanks

--
Best regards,
Luigi

______________________________________________
R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-help&data=04%7C01%7Crmh%40temple.edu%7C3f303633d643499924e208d98cacdaef%7C716e81efb52244738e3110bd02ccf6e5%7C0%7C0%7C637695496888670932%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=98vQNMB7OcS%2B2R73ZMngEeg%2BP6PeP3oCAOUDHxs9SU8%3D&reserved=0
PLEASE do read the posting guide https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.r-project.org%2Fposting-guide.html&data=04%7C01%7Crmh%40temple.edu%7C3f303633d643499924e208d98cacdaef%7C716e81efb52244738e3110bd02ccf6e5%7C0%7C0%7C637695496888670932%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=1yzXmD57qql7UXEKNqdK8Iq1vhfkUYf%2BpX8gvfvD3p0%3D&reserved=0
and provide commented, minimal, self-contained, reproducible code.

	[[alternative HTML version deleted]]



More information about the R-help mailing list