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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:43:13+00:00 2026-06-04T22:43:13+00:00

How can I create some gradient color in matplotlib and then set the parameter

  • 0

How can I create some gradient color in matplotlib and then set the parameter axisbg of my subplot to this?

f = plt.figure()
ax = f.add_subplot(111, axisbg='green')
  • 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-04T22:43:15+00:00Added an answer on June 4, 2026 at 10:43 pm

    This doesn’t use the axisbg parameter, but may do what you want.

    There’s a matplotlib example for gradients: http://matplotlib.sourceforge.net/examples/pylab_examples/gradient_bar.html.
    I tried it myself, this simplified version gives me a green-white gradient background (for some reason when doing this in the interactive python shell I need to call draw() in order for the image to show up):

    import matplotlib.pyplot as mplt  
    fig = mplt.figure()  
    ax = fig.add_subplot(111)  
    mplt.plot([1,2,3],[1,2,1])  
    plotlim = mplt.xlim() + mplt.ylim()  
    ax.imshow([[0,0],[1,1]], cmap=mplt.cm.Greens, interpolation='bicubic', extent=plotlim)  
    mplt.draw()  
    

    Pick another colormap for different gradients.
    Works without 'bicubic' interpolation too, but it’s uglier then.

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

Sidebar

Related Questions

I'm working on this project that an admin user can create some User's Groups
Can I create an event so I can execute some javascript whenever an element
I am trying to initialize directX, but for some reason it can't create d3d
Can some one provide a link to create a simple server and client using
Can you give me some links or example programs to create UIButtons on a
I need to create a slide show of some images that can go full
I would like to create a file which stores some data that can be
Is it possible to create a custom UIPopoverController? Can you give me some suggestions
My application in Django can create some very big SQL queries. I currently use
I have a web app which I can create some notes, each time I

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.