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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:21:23+00:00 2026-05-22T22:21:23+00:00

here is my problem. I have some data I binned to obtain a digitalised

  • 0

here is my problem. I have some data I binned to obtain a “digitalised” pdf, and that’s fine.
Now, I wanted to find a way to indicate different confidence intervals by coloring the bin groups differently.
In particular, starting with the bin containing the highest count I wanted to find and colour, say red, all the highest bins whose area sum to less than say .6. Then, always picking new bins by decreasing counts, i want to colour the bins who increase my red area to .8 in orange.
I was considering using numpy to get bins and counts, sort them into 3 series (red, orange and original colour) and plot them with pyplot’s bar.
Hope you can point out a faster way, thanks!

  • 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-22T22:21:24+00:00Added an answer on May 22, 2026 at 10:21 pm

    If I understand your question correctly, I think the code below will do what you are suggesting. It seems a little different than the approach you were considering, and I’m not sure it is more efficient. Regardless, it usually helps to see the way someone else would do something. It assumes an already generated pdf (histogram) with a bins represented by the varialble “bins” and bin width represented by the variable “binwidth”.

    gray = (.5,.5,.5)
    orange = (1.0, 0.647, 0.0)
    red = (1.0, 0.0, 0.0)
    
    clrs = [gray for xx in bins]
    
    idxs = pdf.argsort()
    idxs = idxs[::-1]
    oranges = idxs[(cumsum(pdf[idxs])*binwidth < 0.8).nonzero()]
    reds = idxs[(cumsum(pdf[idxs])*binwidth < 0.6).nonzero()]
    
    for idx in oranges:
        clrs[idx] = orange
    
    for idx in reds:
        clrs[idx] = red
    
    bar(left=bins,height=pdf,width=binwidth,color=clrs)
    

    Here is a view of the result that I get along with the associated PDF and CDF

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

Sidebar

Related Questions

Here's my problem - I have some code like this: <mx:Canvas width=300 height=300> <mx:Button
Here's my problem: I have a virtual method defined in a .h file that
Here is the problem: I have datagrid binded with data acquired from web service
I have inherited a very old database that needs some data to be updated.
I have some problem here. Here it is: I have this class public class
Here is my scenario: I have some data coming into serial port. I want
Bit of a problem here, basically I have a web address that I use
Looking for some direction here as I'm running into some migration problems. We have
Here is the problem I have: I have a lot (tens of thousands) of
Here is the problem: we have lots of Javascripts and lots of CSS files,

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.