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

  • SEARCH
  • Home
  • 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 8915751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T05:02:42+00:00 2026-06-15T05:02:42+00:00

The default scale for ggplot2 for 13 or more colours does not provide a

  • 0

The default scale for ggplot2 for 13 or more colours does not provide a high degree of visual differentiation.
In addition, the longest of the brewer scales ends at 12 categories (Set3).

Can you recommend a colour scale that would be visually useful for 13 or more categories?

Reproducible example:

dat <- data.frame(value=rnorm(100),
category=sample(letters[1:13],100,replace=T),
other=sample(letters[1:5],100,replace=T))

# Default Scale
ggplot(dat, aes(other,value,color=category)) + 
geom_point(size=6) + 
coord_flip()

# Brewer Scale // notice the blank at the end!
ggplot(dat, aes(other,value,color=category)) + 
geom_point(size=6) + 
coord_flip() + 
scale_color_brewer(palette="Set3")

Note: facetting is not an option in my case (client doesn’t like it, go figure)

  • 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-15T05:02:43+00:00Added an answer on June 15, 2026 at 5:02 am

    You could use colorRampPalette and scale_colour_manual to fudge a 13th category.

    set3 <- colorRampPalette(brewer.pal('Set3',n=12))
    
    ggplot(dat, aes(other,value,color=category)) + 
         geom_point(size=6) + 
         coord_flip() + 
         scale_color_manual(values = setNames(set3(13), levels(dat$category)))
    

    This will break down, in that the colours will not be nicely distinguishable if you set the required numbers too high.

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

Sidebar

Related Questions

Is it possible to set default scale for c# text editor in visual studio
For a high traffic web site we are planning to scale up to use
How does Google scale the Images in Google Maps, Am trying to create an
I have a simple bar graph in ggplot2. I am using the grey scale
I use play2 to create a default scala app: play new test Then: play
I'm writing a BloomFilter and wanted to use Scala's default MurmurHash3 implementation: scala.util.MurmurHash3. My
Default JVM uses maximum 1.5 GB RAM/JVM Java application. But my Server have 8
The default markdown syntax for code blocks is indented by 4 spaces on each
By default, the ordered list looks like this: There are some spacing on the
By default pip installs editable packages into src subdirectory of the directory where Python

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.