org.knowceans.util
Class MayaShades

java.lang.Object
  extended by org.knowceans.util.MayaShades

public class MayaShades
extends java.lang.Object

MayaShades creates Maya-esque visualisations of numeric data -- Maya-esqe because the plotted values resemble the Maya numeric symbols. For presentation of numerical data, the output has several advantages: (1) over numeric data: because the eye directly recognises where in a matrix the large values are located, (2) over visualised Hinton diagrams: because simple console or text file output can be used to present the data. (In a way, MayaShades is similar to the presentation in Hinton diagrams).

In addition to purely "shaded" numerical output, if data are over a specified maximum value, the numeric value is shown instead, resulting in a "heavier" shade that makes it consistent with the symbolic shades. This allows presentation of a specific middle range of data with "analogue" shading, which has proven very useful to visualise discrete probability distributions.

To layout the numeric data in an appropriate width, specific number formatting (unavailable in the NumberFormat framework in the the Java API) is provided for this class, which can be used independent of the shading facility.

Author:
heinrich

Constructor Summary
MayaShades()
           
 
Method Summary
static java.lang.String format(double number, int digits)
          formats a number to the specified number of digits
static java.lang.String format(double number, int digits, int maxlength)
          formats a number to the specified number of digits
static java.lang.String shadeDouble(double[] dd, double max)
          Create a string representation of the vector.
static java.lang.String shadeDouble(double d, double max)
          create a string representation whose gray value appears as an indicator of magnitude, cf.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MayaShades

public MayaShades()
Method Detail

shadeDouble

public static java.lang.String shadeDouble(double[] dd,
                                           double max)
Create a string representation of the vector.

Parameters:
dd -
max -
Returns:

shadeDouble

public static java.lang.String shadeDouble(double d,
                                           double max)
create a string representation whose gray value appears as an indicator of magnitude, cf. Hinton diagrams in statistics. A name for this kind of presentation could be Quertzal from the Maya word Quetzal.

Parameters:
d - value
max - maximum value
Returns:

format

public static java.lang.String format(double number,
                                      int digits,
                                      int maxlength)
formats a number to the specified number of digits

Parameters:
number -
digits - number of active digits
maxlength - maximum length of string
Returns:

format

public static java.lang.String format(double number,
                                      int digits)
formats a number to the specified number of digits

Parameters:
number -
digits - number of active digits
Returns: