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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:21:07+00:00 2026-05-13T15:21:07+00:00

Here’s a plot I made using matplotlib . It uses the bar and scatter

  • 0

Here’s a plot I made using matplotlib. It uses the bar and scatter methods from pylab.
I have 3 issues:

How to make the error bars fatter? No API in bar for this that I can see.
How to specify the axes properly?
How to stop the x-axis labels from showing?

The first is most important, as I have no idea. I guess one more thing would be, how to display the image here in SO? I’ve seen it done but don’t know how.

Here is the code:

import numpy as np
from pylab import *

data1 = np.linspace(12,22,7)
data2 = np.random.normal(loc=15,scale=5,size=10)
data3 = [11,12,18,19,20,26,27]
data = [data1,np.abs(data2),data3]

# n = number of groups
def layout(n,r=7):
    s = r**2   # r = radius of each data point
    #layout from 1 to 100
    margin = 5
    spacer = 10
    group_width = (100 - 2*margin - (n-1)*spacer)*1.0/n
    dot_width = r
    bar_width = group_width - dot_width
    current = margin
    rL = list()
    for i in range(n):
        rL.append(current)        # x for point
        rL.append(current + 3)    # x for bar
        current += group_width + spacer
    return s, bar_width, rL   

s, w, xlocs = layout(len(data))
for group in data:
    x = xlocs.pop(0)
    for e in group:
        scatter(x,e,s=s,color='k')
    m = np.mean(group)
    e = np.std(group)
    x = xlocs.pop(0)
    o = bar(x,m,width=w,color='0.6',
        yerr=e, ecolor='k')

show()

alt text http://img210.imageshack.us/img210/8503/screenshot20100206at703.png

  • 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-13T15:21:08+00:00Added an answer on May 13, 2026 at 3:21 pm

    The error bars are drawn with the errorbar method from within the bar method. It accepts an elinewidth argument but it doesn’t look like you can pass it through the bar method call. I would just draw them manually.

    o, = bar(x,m,width=w,color='0.6', yerr=None) # note the comma after the o
    eBarX = o.get_x()+o.get_width()/2.0
    eBarY = o.get_height()
    errorbar(eBarX,eBarY,e,capsize=7,elinewidth=6,ecolor='k')
    

    To turn the XAxis off use this before you call show:

    axes().xaxis.set_visible(False)
    

    These changes make your plot look like this:
    alt text http://img690.imageshack.us/img690/5141/testfs.png

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

Sidebar

Related Questions

Here is the script I'm using, copied directly from Google: <script type=text/javascript> var _gaq
Here's the basic setup: I have a thin bar at the top of a
Here is the code from my project where I am using a datepicker. The
Here is the Javascript I currently have <script type=text/javascript> $(function() { $('.slideshow').hover( function() {
Here is my problem : I have a post controller with the action create.
Here my problem: @Assert\Regex( * pattern=/^[A-Za-z0-9][A-Za-z0-9\]*$/, * groups={creation, creation_logged} * ) I'm using the
Here is an example: I have the generic type called Account. I wish to
Here is the problem that I am trying to solve. I have two folders
Here's a piece of code I copied from http://www.schillmania.com/content/projects/javascript-animation-1/demo/ Very simple JS animation: function
Here is the code I'm using inside my AsyncTask DefaultHttpClient httpClient = new DefaultHttpClient();

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.