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

Hi Frank,

> 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?

The key point is to get the right relation between the
-0.1 in pBars.coordinates, and the values passed to the
setRange() method for yMap and pBarScaleMap. For example,
I think the following work:

  yMap.setRange(0.0, 40.0);
  pBarScaleMap.setRange(0.0, 2.0);

I suspect the general relation is something like:

  pBars.coordinates = new float[] {0.0f, 0.0f, 0.0f,  0.0f, x, 0.0f};
  yMap.setRange(0.0, y);
  pBarScaleMap.setRange(0.0, x * y / 2.0);

But I could be wrong. Please experiment (and Ugo please
correct me if I'm wrong).

> 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?

New tutorials are always welcome! Just send me the URL and
I'll add a link from the VisAD web page.


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