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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:25:22+00:00 2026-05-25T17:25:22+00:00

I have a lot of graphs I want to plot in one plot. I’ve

  • 0

I have a lot of graphs I want to plot in one plot. I’ve just started with matplotlib and can’t find a good way to generate a lot of distinguishable colors 🙁 Maybe cycling over HSV with SV at maximum?

I’m thinking of something like

args=[]
for i,(x,y) in enumerate(data):
    args.extend([x,y,hsv(i)])
plot(*args)

Any suggestions? 🙂

  • 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-05-25T17:25:23+00:00Added an answer on May 25, 2026 at 5:25 pm

    I think you have the right idea, except that the colors will be more distinguishable if you pass the colormap hsv numbers which are spread out over the range (0,1):

    hsv = plt.get_cmap('hsv')
    hsv(float(i)/(len(data)-1))
    

    or, using NumPy:

    colors = hsv(np.linspace(0, 1.0, len(kinds)))
    

    For example:

    import datetime as DT
    import numpy as np
    import matplotlib.pyplot as plt
    import matplotlib.dates as mdates
    import scipy.interpolate as interpolate
    
    dates = [DT.date(year, 9, 1) for year in range(2003, 2009)]
    t = list(map(mdates.date2num, dates))
    jec = (100, 70, 125, 150, 300, 250)
    plt.plot(dates, jec, 'k.', markersize = 20)
    new_t = np.linspace(min(t), max(t), 80)
    new_dates = map(mdates.num2date, new_t)
    kinds = ('cubic', 'quadratic', 'slinear', 'nearest', 'linear', 'zero', 4, 5)
    cmap = plt.get_cmap('jet')
    colors = cmap(np.linspace(0, 1.0, len(kinds)))
    for kind, color in zip(kinds, colors):
        new_jec = interpolate.interp1d(t, jec, kind=kind)(new_t)
        plt.plot(new_t, new_jec, '-', label=str(kind), color=color)
    plt.legend(loc = 'best')
    plt.show()
    

    enter image description here

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

Sidebar

Related Questions

I have a lot of spare intel linux servers laying around (hundreds) and want
I am working on creating a contour plot using Matplotlib. I have all of
I would have a quite simple question, but can't find any suitable automated solution
I have a simple graph with a lot of points, so I don't want
We have lot of object with this kind of design : Interface and several
I have a requirement to use date picker in my applicaiton. I have lot
At the moment, I have lot's of Java which does all kind of nifty
Have a lot of unnecessary results using contains() method in my query. Don't tell
We have a lot of open discussions with potential clients, and they ask frequently
we have a lot of users running in different shared and solo-owned repositories in

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.