Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8729473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:50:25+00:00 2026-06-13T08:50:25+00:00

When using groups , Lattice gives each group a different color. Example: df <-

  • 0

When using groups, Lattice gives each group a different color. Example:

df <- data.frame(x=1:56, y=rnorm(56), class=1:14) # create some data
xyplot(y ~ x, groups=class, data=df, type="l", auto.key=list(space="right"))

However, by default Lattice only uses seven colors, as running the example above will show. If you have more than seven groups, Lattice cycles through the colors again in order, causing data from distinct groups to have the same color. I learned from another Stackoverflow article that these colors are stored in trellis.par.get()$superpose.symbol$col. I want to make the list of groups colors longer (without having to specify colors explicitly in plotting calls). I can’t figure out how to change this list of colors, however. (This might be due to ignorance about some basic facts about Lattice syntax or semantics.) This illustrates the problem:

> trellis.par.get()$superpose.symbol$col
[1] "#0080ff"   "#ff00ff"   "darkgreen" "#ff0000"   "orange"    "#00ff00"   "brown"    
> class(trellis.par.get()$superpose.symbol$col)
[1] "character"
> mycolors <- c(trellis.par.get()$superpose.symbol$col, "navyblue", "purple", "gold")
> trellis.par.get()$superpose.symbol$col[1:10] <- mycolors
Error in trellis.par.get()$superpose.symbol$col[1:10] <- mycolors : 
  invalid (NULL) left side of assignment

I don’t understand what that error message is telling me.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T08:50:26+00:00Added an answer on June 13, 2026 at 8:50 am

    You should be using trellis.par.set() to set trellis graphical parameters. So:

    trellis.par.set(superpose.symbol = list(col = mycolors))
    

    Bear in mind that this will only change the settings for the currently active device, so that if you create a new graphical device, you will have to reset the color settings.

    Also, this is explained in the help page ?trellis.par.get in the Details section. Please have a look there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem - i can't compile SqlCipher. I'm using this http://groups.google.com/group/sqlcipher/browse_thread/thread/55c6296b56bf4533/c792bbec6df7d4f4?tvc=2#c792bbec6df7d4f4 instructions
I am using GridView for displaying groups of different sets of items in a
I'm creating and updating Groups in Active Directory using the GroupPrincipal class in System.DirectoryServices.AccountManagement
I'm using the cut function to split my data into groups using the max/min
I'm using nested entity groups in an HRD google app engine datastore. A <
[I have posted this at the Django users | Google Groups also.] Using the
I query all security groups in a specific domain using PrincipalSearchResult<Principal> results = ps.FindAll();
We are using the following code to get the groups of an active directory
I am trying to move certain groups of files using wildcards to a folder
Our sysadmin renamed several of our AD groups that we are using in SQL

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.