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.

Matrix representation

Hello VisAD Users:

I have a problem displaying a matriz.  The matrix's values spans from 0
to 6, but when I represent it using a scalarmap all the values bertween
0 and 3 have the same color and other color for the values bertween 4
and 6.   How can I make the displayRenderer assign one color for each
value.

Here is the code I use to buid the ScalarMap.

In the code My_Matrix is a float[][] whit values between 0 and 6

...
...
...

    //Define RealTypes

    xx2 = new RealType("x2");
    yy2 = new RealType("y2");
    xx_yy2 = new RealTupleType(xx2, yy2);
    supClassRes=new RealType("supClassRes");
    func_xy_SC = new FunctionType( xx_yy2, supClassRes);

    //Create display for image classification representation

    displaySC = new DisplayImplJ2D("displaySC");

    //bands for main diaplay

    xxMap2 = new ScalarMap( xx2,  Display.XAxis );
    yyMap2 = new ScalarMap( yy2, Display.YAxis );
    bandUCKMMap = new ScalarMap( supClassRes,  Display.Value );

    displaySC.addMap( xxMap2 );
    displaySC.addMap( yyMap2 );
    displaySC.addMap( bandUCKMMap );

    //data reference for displaySC

    data_refSC = new DataReferenceImpl("data_refSC");
    vals_ffUCKM.setSamples(My_Matrix , false );
    displaySC.addReference( data_refSC );
    displaySC.addDisplayListener(this);
    jPanel14.add(displaySC.getComponent());

...
...
...
...


Thanks,
Ricardo




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