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: Gridded2DSet

Hi John,

>         I have added a Gridded 2DSet to one of my current X-Y Plots.  The XY
> Plot is defined by the following:  the domain of my data set runs from 2 to
> 18 while the range is from -40 to 0.  I created the Gridded2DSet and added
> it to the display.  However, the Gridded2DSet is placed onto its own scale
> and does not correspond to the values represented by the XY Plot.  How can I
> apply these to the same scale?  The values for the Gridded2DSet are points
> bracketing the domain and range respectively.  Please advise.

If the XY Plot has MathType (x -> y) and the Gridded2DSet has
MathType Set(a, b), if I understand you right, then do something
like:

  ScalarMap xmap = new ScalarMap(x, Display.XAxis);
  display.addMap(xmap);
  ScalarMap ymap = new ScalarMap(y, Display.YAxis);
  display.addMap(ymap);
  ScalarMap amap = new ScalarMap(a, Display.XAxis);
  display.addMap(amap);
  ScalarMap bmap = new ScalarMap(b, Display.YAxis);
  display.addMap(bmap);
  xmap.setRange(xlow, xhi);
  ymap.setRange(ylow, yhi);
  amap.setRange(xlow, xhi);
  bmap.setRange(ylow, yhi);

That is, set the same range for x and a, and the same
range for y and b. Then x and a values will line up,
and y and b values will line up.

Cheers,
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


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