How to label panels in lattice

后端 未结 1 2005
我在风中等你
我在风中等你 2021-01-02 09:10

here is a simple problem that surely you already come across, but is giving me a big headache...

I have a dataframe like this:

set.seed(3)
mydata <         


        
1条回答
  •  生来不讨喜
    2021-01-02 09:56

    You almost got it. If you need letters, then index letters with panel.number():

    xyplot(var ~ temp | subj, 
       data = mydata,
       strip=FALSE,
       panel = function(x, y,...) {
               panel.xyplot(x, y,...)
               panel.text(1,21,labels=letters[panel.number()])
               }) 
    

    You can also define another character vector inside your panel function and use this indexing schema with it.

    0 讨论(0)
提交回复
热议问题