jfig.utils
Class MHG.Axes

java.lang.Object
  extended byjfig.utils.MHG.Axes
Enclosing class:
MHG

public class MHG.Axes
extends java.lang.Object

the wrapper class responsible to transform world-coordinates to FIG coordinates at 2400 dpi. We follow the Matlab convention and create a default figure of size 8x6 inches (aspect 4:3). The default transformation maps the axis (xmin,ymin) origin to relative position (0.13, 0.11), that is (0.13*8*2400,0.11*6*2400) or (2496,1584) in absolute FIG coordinates. Similarly, (xmax,ymax) is mapped to (0.13+0.775,0.11+0.815) or (17376, 13320).


Field Summary
(package private)  double FIGURE_HEIGHT
           
(package private)  double FIGURE_WIDTH
           
(package private)  double x_factor
           
(package private)  double X_OFFSET
           
(package private)  double X_SIZE
           
(package private)  double xmax
           
(package private)  double xmin
           
(package private)  double y_factor
           
(package private)  double Y_OFFSET
           
(package private)  double Y_SIZE
           
(package private)  double ymax
           
(package private)  double ymin
           
 
Constructor Summary
MHG.Axes()
           
 
Method Summary
 void autoscaleClipped(double[] x, double[] y)
           
 void autoscaleTight(double[] x)
          auto-scale this Axes transformation to fit the given array x[].
 void autoscaleTight(double[] x, double[] y)
          auto-scale the world-coordinates to unit-cube mapping for this Axes from the given x- and y-values.
 double clip(double value, double min, double max)
          clip value to the range [min..max].
 double figToWorldCoordsX(int figX)
           
 double figToWorldCoordsY(int figY)
           
 double[] getBounds()
           
 java.awt.Point[] getPoints(double[] x, double[] y)
           
 int getWX(double x)
          special functions for title,xlabel,ylabel etc: use outer trafo only
 int getWY(double y)
           
 int getX(double x)
           
 double getXmax()
           
 double getXmin()
           
 int getY(double y)
           
 double getYmax()
           
 double getYmin()
           
 void setRectangle(double[] lbwh)
          set some transformation parameters for this Axes: the array lbwh is expected to hold the values for the left, bottom, with, height parameters, each of which should be in the interval [0..1].
 void setTrafo(double x1, double x2, double y1, double y2)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FIGURE_WIDTH

double FIGURE_WIDTH

FIGURE_HEIGHT

double FIGURE_HEIGHT

X_OFFSET

double X_OFFSET

Y_OFFSET

double Y_OFFSET

X_SIZE

double X_SIZE

Y_SIZE

double Y_SIZE

xmin

double xmin

xmax

double xmax

ymin

double ymin

ymax

double ymax

x_factor

double x_factor

y_factor

double y_factor
Constructor Detail

MHG.Axes

public MHG.Axes()
Method Detail

getXmin

public double getXmin()

getXmax

public double getXmax()

getYmin

public double getYmin()

getYmax

public double getYmax()

getX

public int getX(double x)

getY

public int getY(double y)

getPoints

public java.awt.Point[] getPoints(double[] x,
                                  double[] y)

figToWorldCoordsX

public double figToWorldCoordsX(int figX)

figToWorldCoordsY

public double figToWorldCoordsY(int figY)

getWX

public int getWX(double x)
special functions for title,xlabel,ylabel etc: use outer trafo only


getWY

public int getWY(double y)

clip

public double clip(double value,
                   double min,
                   double max)
clip value to the range [min..max].


setRectangle

public void setRectangle(double[] lbwh)
set some transformation parameters for this Axes: the array lbwh is expected to hold the values for the left, bottom, with, height parameters, each of which should be in the interval [0..1].


setTrafo

public void setTrafo(double x1,
                     double x2,
                     double y1,
                     double y2)

getBounds

public double[] getBounds()

autoscaleTight

public void autoscaleTight(double[] x)
auto-scale this Axes transformation to fit the given array x[]. We use (0,x.length) for the x-axis and (x.min,x.max) for the y-axis.


autoscaleTight

public void autoscaleTight(double[] x,
                           double[] y)
auto-scale the world-coordinates to unit-cube mapping for this Axes from the given x- and y-values.


autoscaleClipped

public void autoscaleClipped(double[] x,
                             double[] y)