NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

Re: VisADLineArray() to make histogram bars - why do they float?

Bill,

Thanks. Of course, you're absolutely right. I got rid of that other ScalarMap(intensity, Display.YAxis), and the floating went away. However, now I can't get it to give me a scale on the intensity axis. Do I have to include a new (dummy) map to get it to display that? I'm already doing setRange and setScaleEnable(1) on the pBarMap and pBarScaleMap.

-Frank

At 11:00 AM 9/9/2002, Bill Hibbard wrote:
Hi Frank,

> I'm back with another question on using VisADLineArray to make histogram
> bars. In previous episodes (about a month back), with help from Bill, Tom
> and Ugo, I've created a vertical bar, attached it to a vertical ScaleMap,
> so that its length is determined by the variable on that axis. What I don't
> understand is how this length is determined: if I have a little line (in
> Jython)
>
> # Idea from Ugo
> pBarMap = ScalarMap(intensity, DisplayShape)
> pBarScaleMap = ScalarMap(intensity, DisplayShapeScale)
>
> pBars = VisADLineArray()
> pBars.vertexCount = 2
> x = 1.0
> pBars.coordinates = [ 0.0, 0.0, 0.0,    0.0, x, 0.0]
> pBarScaleMap.setRange(0.0, x/2.0) # Scale as recommended by Bill H.
>
> I would expect that when this line is scaled, the first vertex should
> remain unchanged at [0.0, 0.0, 0.0]. Instead, there appears to be some
> vertical translation as well as scaling, so that the scaled lines no longer
> begin at the horizontal axis, but instead float at a height related to the
> intensity value to which they are mapped - they not only get bigger as the
> intensity increases, they also "float" higher.

Do you also have a ScalarMap of intensity to YAxis, or to
any other DisplayRealType? A map to YAxis could cause the
lines to rise with increasing intensity.

Cheers,
Bill

PhD, Computational Biologist,
Harvard Medical School BCMP/SGM-322, 250 Longwood Ave, Boston MA 02115, USA.
Tel: 617-432-3555 Fax: 617-432-3557 http://llama.med.harvard.edu/~fgibbons


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