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.
Hi Ricardo, I just tried an experiment, modifying visad/examples/Test22.java to map ir_radiance to Display.Value, eliminate the maps to Hue and Saturation, and set ir_radiance to only have values 0, 1, 2, 3, 4, 5 and 6. It worked fine for me - I saw seven shades of grey. So I am not sure what is wrong in your program. Make sure you don't have a setRange() call on your ScalarMap to Display.Value, and that subClassRes values really are what you think they are. Good luck, Bill ---------------------------------------------------------- Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI 53706 hibbard@xxxxxxxxxxxxxxxxx 608-263-4427 fax: 608-263-6738 http://www.ssec.wisc.edu/~billh/vis.html On Fri, 30 Jun 2000, Ricardo Ivan Mantilla G wrote: > 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 > > > >
visad
archives: