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


I am working on enhancing the 3D surface plotting functionality of the
MZmine metabolomic platform:


I've been asked to provide support for logarithmic scaling of the plot's
intensity (z-) axis.

I've managed to get this working based on the LogTest example


but there's a wrinkle.  Peaks in the surface plot are labelled with
identified metabolites, see for example this image:


I am struggling to define a FunctionType that will correctly position
the labels when logarithmic scaling is applied.

The code I'm using is at the end of the message.  It positions the
labels correctly when linear scaling is applied but their positions are
unchanged when switching to logarithmic scaling.  This is because I
haven't been able to define the annotationFunction to correctly
reference the logCoordinateSystem.  How can I do so?

I'd be grateful for your help.


        // Domain.
        final RealType retentionTimeType = RealType.getRealType("RT",
        final RealType mzType = RealType.getRealType("m/z");
        domainTuple = new RealTupleType(retentionTimeType, mzType);

        // Range.
        final RealType intensityType = RealType.getRealType("Intensity");
        final RealType logType = RealType.getRealType("LogValues",
        final RealTupleType logReference = new RealTupleType(logType);
        final LogCoordinateSystem logCoordinateSystem = new
LogCoordinateSystem(logReference, LOG_BASE);
        final RealTupleType intensityRange = new
RealTupleType(intensityType, logCoordinateSystem, null);

        peakHeightType = RealType.getRealType("Height");
        annotationType = TextType.getTextType("Annotation");
        pointTupleType = new RealTupleType(retentionTimeType, mzType,
        annotationTupleType = new TupleType(new
MathType[]{peakHeightType, annotationType});

        // Create a function from domain (retention time and m/z) to
        intensityFunction = new FunctionType(domainTuple, intensityRange);

        // Create a function from domain (retention time and m/z) to
text annotation.
        annotationFunction = new FunctionType(domainTuple,

        // Create a DataReference connecting data to display.
        dataReference = new DataReferenceImpl("data");

        // Create mapping for X,Y,Z axes and color.
        retentionTimeMap = new ScalarMap(retentionTimeType, Display.XAxis);
        mzMap = new ScalarMap(mzType, Display.YAxis);
        intensityMap = new ScalarMap(intensityType, Display.ZAxis);
        logIntensityMap = new ScalarMap(logType, Display.ZAxis);
        heightMap = new ScalarMap(peakHeightType, Display.ZAxis);
        colorMap = new ScalarMap(intensityType, Display.RGB);
        annotationAlphaMap = new ScalarMap(peakHeightType, Display.Alpha);
        final ScalarMap annotationMap = new ScalarMap(annotationType,

        // Add maps to display.

Syngenta Limited, Registered in England No 2710846
Registered Office : Syngenta Limited, European Regional Centre, Priestley Road, 
Surrey Research Park, Guildford, Surrey, GU2 7YH, United Kingdom

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: