Re: Got any tips for drawing 2d graphs with error bars, symbols,etc?

Bill, (and Ugo),

Thanks for that pointer. That's exactly what I need. I've translated it to Jython, and it seems to work, but not quite (or maybe I'm missing something): the bars are tied to the values in samples_Precip as symbols through pBarMap, and the bar lengths are tied to the same values with pBarScaleMap. And I get the part about having the pBars.coordinates to be a vertical line of arbitrary length to be controlled by samples_Precip.

Given that the arbitrary lines defined for pBars are (0.0, 0.0, 0.0, 0.0, -0.1, 0.0), and that my precipitation values are always positive, I expect to see vertical lines coming from below the horizontal axis up to my data points. Instead, I see bars floating in mid-air, starting at the data point, and extending a vertical distance upwards that is controlled by the value along the y-axis. I have to change the '-0.1' to '-10.0' in order to see what I describe above. I guess I need a rangewidget to cut off those lines at y=0.0.

Can anyone explain the threshold effect of the negative value for the pBars - shouldn't any negative value cause the desired lines from below y=0 up to the data point?

Apart from that question, the idea is awesome - I think it'll let me do everything I need to do. Too bad it doesn't appear to be in the tutorials anywhere... What's the status of that - is there some way to contribute examples, tutorial material, etc to this project?



At 11:01 AM 8/5/2002, Bill Hibbard wrote:
Hi Frank,

> I'm trying to create a two-dimensional display of some mass-spectrometry
> results (observed and theoretical). For my particular work right now, that
> means I'd like to create the following for each data point (x,y):
>          1. a vertical line that runs from (x,0) up to (x,y)
>          2. a point somewhere along that vertical line (probably at the
> top), indicating the mean value of the signal y for that x-value.
>          3. two (or more) horizontal bars, one above the mean point, one
> below, to indicate some kind of statistics (standard deviation, percentile
> score, ... - basically some kind of error bar)
>  From Ugo's excellent tutorial, I can see how to put in the point (in 2.
> above) along with the lines. However, it's not clear how I can put in the
> vertical lines. I guess I can fulfill 1. and 3. by using subs.drawLine()
> function to draw the lines item by item. I'm just wondering if there isn't
> a more "built-in" way of doing this for the set as a whole.

See Ugo's message about making bar graphs at:

You may be able to translate this logic into VisAD-Python.

> Also, if I wanted to use a symbol for the point-markers in 2., is there any
> way for me to do that? Instead of just a dot, could I put in a 'star' (*),
> a cross (+) or some other textual symbol easily?

The Shape logic may help you do this. This logic is accessible
from VisAD-Python as described at:

Good luck,
Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI  53706
hibbard@xxxxxxxxxxxxxxxxx  608-263-4427  fax: 608-263-6738

PhD, Computational Biologist,
Harvard Medical School BCMP/SGM-322, 250 Longwood Ave, Boston MA 02115, USA.
Tel: 617-432-3555 Fax: 617-432-3557

  • 2002 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: