Re: Newbie questions

Hi Carlos,

> I have 4 different series, I have been able to graph the four series in
> the same display with different colors. But I would like to add a simple
> box with a legend indicating each color meaning. I don't know how to do
> this.

One way to make the box is as a RealTuple with MathType
(x, y, s) and ScalarMaps x -> XAxis, y -> YAxis and
s -> Shape. Create the box as a VisADLineArray that
you pass to the setShapes() method of the ShapeControl
you get from the getControl() method of your ScalarMap
to Shape. See visad/examples/Test47.java for an example.

For the text label, make a RealTuple with MathType
(x, y, t) where t is a TextType, and a ScalarMap
of its t to Text. See visad/examples/Test45.java for
an example.

> My Yaxis values range from -40 to 10, I would like to have the X axis at
> 0 instead of -40.

For this, you may need to turn the box off (call the
setBoxOn(false) method of your DisplayRenderer), and draw
an X axis as a Shape or as a Gridded2DSet with manifold
dimension = 1 (i.e., a line).

> Another question is what I should do to have values each 3 or 4 ticks, I
> have tried with  this:
>
>       axisScale.setVisible(true);
>       axisScale.setTickBase((double)1);
>       axisScale.setMinorTickSpacing((double)5);
>       axisScale.setMajorTickSpacing((double)10);
>
> Ando did not work.

Perhaps Don nows the answer to this.

Good luck,
Bill


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