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 9123519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:21:36+00:00 2026-06-17T06:21:36+00:00

Matplotlib only defines below basic colors: •b: blue •g: green •r: red •c: cyan

  • 0

Matplotlib only defines below basic colors:

•b: blue
•g: green
•r: red
•c: cyan
•m: magenta
•y: yellow
•k: black
•w: white

And I want to define more custom color letters, such as

mc1 = RGB(164,106,228)
mc2 = RGB(220,170,114)
mc3 = RGB(249,85,132)

then I can define

my_color_list = ['g','r','y','b','c','m','k', 'mc1','mc2','mc3']

Then my_color_list can be use for below demo:

import matplotlib.pyplot as plt
dt = [1,2,3,4,5,6,7,8,9]
my_color_list = ['g','r','y','b','c','m','k', 'mc1','mc2','mc3'] # not valid 
bar(range(len(dt)),dt,color=my_color_list)
plt.show()

So how to define customize color letter in matplotlib ? Or, if I have a list of RGB tuple, how to combine RGB tuple together with basic color letters and assign to ‘color’ parameter of ‘plot’/’bar’ command ?

  • 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-17T06:21:37+00:00Added an answer on June 17, 2026 at 6:21 am

    matplotlib supports many ways to specify the color. In addition to the basic colors, you can use CSS color hex codes, Web color names and RGB values.

    • Hex code: a Python string, e.g. '#d2691e'.
    • Web color name: a Python string, e.g. 'chocolate'.
    • RGB values: a Python tuple, in the order of RGB: (0.824, 0.412, 0.118). The components should be normalized to fall within [0, 1].
    • Greyscale: a Python string giving the greyscale, e.g. '0.7'.

    Whenever a color is expected, these forms can be used just like the standard one-letter color names.

    See: http://matplotlib.org/api/colors_api.html

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

Sidebar

Related Questions

I am using Python matplotlib. i want to superimpose scatter plots. I know how
I have a matplotlib code that generates a simple 2D chart. I want to
I am playing with matplotlib - I have a bar chart, and I want
I'm having a problem with matplotlib where it only plots a line the first
Whenever, I want to plot multiple 2d line graphs graphs with matplotlib, I define
I want to plot a sequence of .png images in matplotlib. The goal is
I want to plot (i.e. write a file) with matplotlib from a script that
The latest matplotlib download page only shows OS X 10.3 download options for mac.
I would like to make a matplotlib plot having only the left and bottom
I am new to Matplotlib and Python. I mostly use Matlab. Currently, I am

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.