Re: display groups of same lines types with different scale

Hi Bill,

thanks for your fast statement,

ok, now i add all Maps before i set the DataReferences - the source looks
like this:

myDisplay.clearMaps();
myDisplay.getGraphicsModeControl().setScaleEnable(true);
myDisplay.addMap(new ScalarMap(RealType.XAxis, Display.XAxis)); //x map
myDisplay.addMap(new ScalarMap( RealType.YAxis, Display.YAxis)); //ymap 1
myDisplay.addMap(new ScalarMap( RealType.YAxis, Display.YAxis)); //ymap 2

i get the following error in  line 4:
visad.BadMappingException: Display.addMap: two ScalarMaps with the same
RealType & DisplayRealType

is it possible to add more than one ScalarMap with identical type?
or, what should i use instead of that to display lines of same data-type
with different scales on YAxis . Do you have a short example to do this?

thanks
tom

----- Original Message -----
From: "Bill Hibbard" <billh@xxxxxxxxxxxxx>
To: "Thomas Bauer" <thomas.bauer@xxxxxxxxxxxx>
Sent: Friday, October 25, 2002 10:29 PM
Subject: Re: display groups of same lines types with different scale


> Hi Thomas,
>
> > i'm looking forward to display multiple lines in same display. now i
want to group the scale of some lines and display axis-title and axis-thick
for each group of line.
> > .
> > e. g.:
> > line1, line2 -> scale 1 -> axis-scale on primary
> > line3 -> scale 2 -> axis-scale on secondary
> > line4, line5, line6 -> axis-scale on primary
> > line7 -> axis-scale on secondary
> > ... and so on
> >
> > my code:
> >
> > ....
> > myDisplay.removeAllReferences();
> > myDisplay.addMap(new ScalarMap(RealType.XAxis, Display.XAxis)); //x map
> > myDisplay.addMap(new ScalarMap( RealType.YAxis, Display.YAxis)); //y-map
> >
> > Gridded2DDoubleSet set = new Gridded2DDoubleSet(new
RealTupleType(RealType.XAxis ,
> > RealType.YAxis),
> > values,
> > values[0].length);
> >
> > DataReference ref = new DataReferenceImpl("data" + i); //data-reference
> > ref.setData(set);
> > ...
> > myDisplay.addReference(ref,new ConstantMap[] {r,g,b});
> >
> > if i want to add a second y-map to the display, i have got this error
message:
> > visad.DisplayException: DisplayImpl.addMap(): ScalarType may not occur
in any DataReference
>
> This message indicates that the RealType in your ScalarMap
> occurs in a DataReference already linked to the DisplayImpl.
>
> If possible, addMap() all the ScalarMaps before your
> addReference() any Data.
>
> Note also that you cannot add another identical:
>   ScalarMap( RealType.YAxis, Display.YAxis)
>
> > whats my  problem?
> > is it possible to display a few groups of Griddet2DDoubleSet with
different scale, seperate axis-titles and axis-labels?
>
> To get different axis scales etc, use different RealTypes
> in each Set, each with its own ScalarMap (addMap() all at
> the start).
>
> > is the issue with "axis title overlaps axis tick labels resolved? I
asked this question about five month ago and found and answer in the
> > archives. i have tested this problem using a new version of visAD, but i
did not see it fixed.
>
> Perhaps Don knows the answer to this.
>
> Good luck,
> Bill
>
>