Class PlotLegend
java.lang.Object
com.eco.bio7.spatial.PlotLegend
A legend of the 3D view (see SpatialUtil.setLegend and
SpatialUtil.setColorBar): the labels with the colors of categories (e.g., the
groups of a scatter plot) or a color bar of a continuous color ramp with the
numbers of the values (e.g., the heights of a surface).
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int[]A color ramp (blue - white - red) for values below and above a center.static final int[]A color ramp (blue - cyan - green - yellow - red).static final int[]A color ramp of the heights of a landscape (green - brown - white).static final int[]A color ramp (dark blue - green - yellow, like viridis). -
Method Summary
Modifier and TypeMethodDescriptionstatic intrampColor(int[] colors, double min, double max, double value) Returns the color (0xRRGGBB) of a value of a color ramp (the colors are evenly distributed from the minimum to the maximum and interpolated), e.g., to draw the data with the colors of a color bar.static voidsetColor(com.jogamp.opengl.GL2 gl, int rgb) Sets the OpenGL color of a color (0xRRGGBB), e.g., of a color of a legend or of rampColor.
-
Field Details
-
VIRIDIS
public static final int[] VIRIDISA color ramp (dark blue - green - yellow, like viridis). -
RAINBOW
public static final int[] RAINBOWA color ramp (blue - cyan - green - yellow - red). -
DIVERGING
public static final int[] DIVERGINGA color ramp (blue - white - red) for values below and above a center. -
TERRAIN
public static final int[] TERRAINA color ramp of the heights of a landscape (green - brown - white).
-
-
Method Details
-
rampColor
public static int rampColor(int[] colors, double min, double max, double value) Returns the color (0xRRGGBB) of a value of a color ramp (the colors are evenly distributed from the minimum to the maximum and interpolated), e.g., to draw the data with the colors of a color bar.- Parameters:
colors- the colors of the ramp (0xRRGGBB)min- the value of the first colormax- the value of the last colorvalue- the value (clamped to the range)- Returns:
- the color (0xRRGGBB)
-
setColor
public static void setColor(com.jogamp.opengl.GL2 gl, int rgb) Sets the OpenGL color of a color (0xRRGGBB), e.g., of a color of a legend or of rampColor.- Parameters:
gl- the OpenGL contextrgb- the color (0xRRGGBB)
-