Re: [visad] How can I apply logarithmic scaling to Display.Text position?


Thanks very much Don. The code you provided does work to create boxes whose heights are logarithmically scaled.

However, in the application I'm working on I'm providing a toggle that allows the user to dynamically switch between linear and logarithmic scaling of the z-axis (intensity & height). Here's the code that is called when the switch is made:

public void setUseLog10Intensity(final boolean useLog10) throws VisADException, RemoteException {

  useLog10Intensity = useLog10;

  // Update maps.
  if (useLog10Intensity) {
  } else {

  // Reset range.
  setIntensityRange(0.0, maxIntensity);

So, would your suggestion below achieve this toggling ability?

... you need to have something that will map
your raw height values to the logrithmic vertical dimension.  One way
would be to add a CoordinateSystem to the pointTupleType so you would
have the logHeightType in the domain (through the CS) and the mapping
would be picked up. You don't want to change retentionTimeType or
mzType, so you want to have IdentityCoordinateSystems for those values.
So, you could have  IdentityCS's for retentionTimeType and mzType and
then have a CartesianProductCoordinateSystem of those and the
LogCoordinateSystem for the height and attach that to your
> pointTupleType.

I tried defining pointTupleType as follows:

new RealTupleType(
  new CartesianProductCoordinateSystem(
    new CoordinateSystem[]{
      new IdentityCoordinateSystem(
        new RealTupleType(retentionTimeType)),
      new IdentityCoordinateSystem(new RealTupleType(mzType)),
      new LogCoordinateSystem(new RealTupleType(heightType)}),

but this produces a warning:

Single DisplayRealType DisplayXAxis occurs more than once: ShadowType.testIndices

and no highlight boxes.

I could maintain two sets of boxes (linear and logarithmic heights) and show/hide them as the user switches scaling modes but I thought a more "elegant" solution might be possible.

For reference, the two classes I've been working on are in the mzmine svn repository:



Thanks again for your help.


This message may contain confidential information. If you are not the designated recipient, please notify the sender immediately, and delete the original and any copies. Any use of the message by you is prohibited.

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