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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:04:57+00:00 2026-06-12T18:04:57+00:00

I’m trying to replicate a certain plot using matplotlib: it should look something like

  • 0

I’m trying to replicate a certain plot using matplotlib: it should look something like this.

Final plot

I have seen that it it possible to use the PolarAxes to draw radial points: for istance i’ve made a really simple polar plot with the following snippet:

import matplotlib.pyplot as plt
fig = plt.figure()
# Set the axes as polar
ax = fig.add_subplot(111, polar=True)
# Draw some points
ax.plot([0],[1], 'o')
ax.plot([3],[1], 'o')
ax.plot([6],[1], 'o')

# Go clockwise
ax.set_theta_direction(-1)
# Start from the top
ax.set_theta_offset(1.570796327)

plt.savefig('test.png')

And i get something like this:

First example

So my question is: is there a way to draw the lines as in the first figure, and to adjust the width in order to fit in the whole circonference? Also some hints on how to handle the colors would be much appreciated.

UPDATE: the data that has to be plotted is quite simple: each track is an array of floats whose range is between 0 and 9 (and the color is derived from the colormap RdYlGn). The array length are multiple of 96.

UPDATE 2: that’s the snipped that i have used

# mydata is a simple list of floats
a = np.array([[x for i in range(10)] for x in mydata])

# construct the grid
radius = np.linspace(0.2,0.4,10)
theta = np.linspace(0,2*np.pi,len(a))
R,T  = np.meshgrid(radius,theta)

fig = plt.figure()
ax = fig.add_subplot(111, polar = True)

# plot the values using the appropriate colormap
ax.pcolor(T,R,a,cmap=cm.RdYlGn)
  • 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-12T18:04:58+00:00Added an answer on June 12, 2026 at 6:04 pm

    Without more information about how your data is organized it is difficult to say what the best way to recreate this plot would be. It is easy to draw lines of different widths and colors on a polar plot. Though if you need as many as in your example, things may get slow. I have also provided an example of a polar pseudo-color plot.

    import numpy as np
    import matplotlib.pyplot as plt
    
    #Create radius and theta arrays, and a 2d radius/theta array
    radius = np.linspace(0.2,0.4,51)
    theta = np.linspace(0,2*np.pi,51)
    R,T  = np.meshgrid(radius,theta)
    
    #Calculate some values to plot
    Zfun = lambda R,T: R**2*np.cos(T)
    Z = Zfun(R,T)
    
    #Create figure and polar axis
    fig = plt.figure()
    ax = fig.add_subplot(111, polar = True)
    
    ax.pcolor(T,R,Z)    #Plot calculated values
    
    #Plot thick red section and label it
    theta = np.linspace(0,np.pi/4,21)
    ax.plot(theta,[1.23 for t in theta],color='#AA5555',linewidth=10)   #Colors are set by hex codes
    ax.text(np.pi/8,1.25,"Text")
    
    ax.set_rmax(1.25)   #Set maximum radius
    
    #Turn off polar labels
    ax.axes.get_xaxis().set_visible(False)
    ax.axes.get_yaxis().set_visible(False)
    

    Plot

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a small JavaScript validation script that validates inputs based on Regex. I
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace
I am trying to render a haml file in a javascript response like so:
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into

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.