|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
edu.mines.jtk.mosaic.PlotFrame
edu.mines.jtk.mosaic.SimplePlot
public class SimplePlot
A simple plot is easy to construct and especially useful for quick diagnostic plots of arrays of floats or doubles. Specifically, a simple plot is a plot frame with only one plot panel.
For example, a simple plot of an array float[] f can be displayed with
SimplePlot.asSequence(f);
Likewise, a simple plot of an array float[][] f can be displayed with
SimplePlot.asPixels(f);
The plots in these examples use default parameters and cannot be
customized easily. More complex plots can be constructed as in this
example:
SimplePlot plot = new SimplePlot();
plot.addGrid("H-.V-.");
PointsView pv = plot.addPoints(f);
pv.setStyle("r-o");
plot.setTitle("A plot of an array");
plot.setVLabel("array value");
plot.setHLabel("array index");
| Nested Class Summary | |
|---|---|
static class |
SimplePlot.Origin
The origin can be either at the upper-left or lower-left of the plot. |
| Nested classes/interfaces inherited from class edu.mines.jtk.mosaic.PlotFrame |
|---|
PlotFrame.Split |
| Nested classes/interfaces inherited from class javax.swing.JFrame |
|---|
javax.swing.JFrame.AccessibleJFrame |
| Nested classes/interfaces inherited from class java.awt.Frame |
|---|
java.awt.Frame.AccessibleAWTFrame |
| Nested classes/interfaces inherited from class java.awt.Window |
|---|
java.awt.Window.AccessibleAWTWindow |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
java.awt.Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary |
|---|
| Fields inherited from class javax.swing.JFrame |
|---|
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled |
| Fields inherited from class java.awt.Frame |
|---|
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface javax.swing.WindowConstants |
|---|
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
SimplePlot()
Constructs a simple plot with default lower-left origin. |
|
SimplePlot(SimplePlot.Origin origin)
Constructs a simple plot with specified origin. |
|
| Method Summary | |
|---|---|
boolean |
add(TiledView tv)
Adds the specified tiled view to this plot's panel. |
ColorBar |
addColorBar()
Adds the color bar with no label. |
ColorBar |
addColorBar(java.lang.String label)
Adds the color bar with specified label. |
GridView |
addGrid()
Adds a grid view. |
GridView |
addGrid(java.lang.String parameters)
Adds a grid view with specified parameters string. |
PixelsView |
addPixels(double[][] f)
Adds a pixels view of the specified sampled function f(x1,x2). |
PixelsView |
addPixels(float[][] f)
Adds a pixels view of the specified sampled function f(x1,x2). |
PixelsView |
addPixels(Sampling s1,
Sampling s2,
double[][] f)
Adds a pixels view of the specified sampled function f(x1,x2). |
PixelsView |
addPixels(Sampling s1,
Sampling s2,
float[][] f)
Adds a pixels view of the specified sampled function f(x1,x2). |
PointsView |
addPoints(double[] f)
Adds a points view of specified values f(x). |
PointsView |
addPoints(double[] x,
double[] y)
Adds a points view of specified values (x,y). |
PointsView |
addPoints(float[] f)
Adds a points view of specified values f(x). |
PointsView |
addPoints(float[] x,
float[] y)
Adds a points view of specified values (x,y). |
PointsView |
addPoints(Sampling s,
double[] f)
Adds a points view of a sampled function f(x). |
PointsView |
addPoints(Sampling s,
float[] f)
Adds a points view of a sampled function f(x). |
SequenceView |
addSequence(double[] f)
Adds a sequence view with specified values f(x). |
SequenceView |
addSequence(float[] f)
Adds a sequence view with specified values f(x). |
SequenceView |
addSequence(Sampling s,
double[] f)
Adds a sequence view with specified sampling and values f(x). |
SequenceView |
addSequence(Sampling s,
float[] f)
Adds a sequence view with specified sampling and values f(x). |
void |
addTitle(java.lang.String title)
Adds the plot title. |
static SimplePlot |
asPixels(double[][] f)
Returns a new plot with a pixels view of a sampled function f(x1,x2). |
static SimplePlot |
asPixels(float[][] f)
Returns a new plot with a pixels view of a sampled function f(x1,x2). |
static SimplePlot |
asPixels(Sampling s1,
Sampling s2,
double[][] f)
Returns a new plot with a pixels view of a sampled function f(x1,x2). |
static SimplePlot |
asPixels(Sampling s1,
Sampling s2,
float[][] f)
Returns a new plot with a pixels view of a sampled function f(x1,x2). |
static SimplePlot |
asPoints(double[] f)
Returns a new plot with a points view of specified values f(x). |
static SimplePlot |
asPoints(double[] x,
double[] y)
Returns a new plot with a points view of specified values (x,y). |
static SimplePlot |
asPoints(float[] f)
Returns a new plot with a points view of specified values f(x). |
static SimplePlot |
asPoints(float[] x,
float[] y)
Returns a new plot with a points view of specified values (x,y). |
static SimplePlot |
asPoints(Sampling s,
double[] f)
Returns a new plot with a points view of a sampled function f(x). |
static SimplePlot |
asPoints(Sampling s,
float[] f)
Returns a new plot with a points view of a sampled function f(x). |
static SimplePlot |
asSequence(double[] f)
Returns a new plot with a sequence view of specified values f(x). |
static SimplePlot |
asSequence(float[] f)
Returns a new plot with a sequence view of specified values f(x). |
static SimplePlot |
asSequence(Sampling s,
double[] f)
Returns a new plot with a sequence view of a sampled function f(x). |
static SimplePlot |
asSequence(Sampling s,
float[] f)
Returns a new plot with a sequence view of a sampled function f(x). |
PlotPanel |
getPlotPanel()
Gets the plot panel for this plot. |
boolean |
remove(TiledView tv)
Removes the specified tiled view from this plot's panel. |
void |
removeTitle()
Removes the plot title. |
void |
setHFormat(java.lang.String format)
Sets the format for the horizontal axis. |
void |
setHLabel(java.lang.String label)
Sets the label for the horizontal axis. |
void |
setHLimits(double hmin,
double hmax)
Sets limits for the horizontal axis. |
void |
setHLimitsDefault()
Sets default limits for the horizontal axis. |
void |
setLimits(double hmin,
double vmin,
double hmax,
double vmax)
Sets limits for the both horizontal and vertical axes. |
void |
setLimitsDefault()
Sets default limits for horizontal and vertical axes. |
void |
setTitle(java.lang.String title)
Sets the plot title. |
void |
setVFormat(java.lang.String format)
Sets the format for the vertical axis. |
void |
setVLabel(java.lang.String label)
Sets the label for the vertical axis. |
void |
setVLimits(double vmin,
double vmax)
Sets limits for the vertical axis. |
void |
setVLimitsDefault()
Sets default limits for the vertical axis. |
| Methods inherited from class edu.mines.jtk.mosaic.PlotFrame |
|---|
getModeManager, getMouseTrackMode, getPlotPanelBottomRight, getPlotPanelTopLeft, getTileZoomMode, paintToPng, setBackground, setFont, setFontSize, setForeground |
| Methods inherited from class javax.swing.JFrame |
|---|
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update |
| Methods inherited from class java.awt.Frame |
|---|
addNotify, finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setUndecorated |
| Methods inherited from class java.awt.Window |
|---|
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, setLocationRelativeTo, show, toBack, toFront |
| Methods inherited from class java.awt.Container |
|---|
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
| Methods inherited from class java.awt.Component |
|---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.awt.MenuContainer |
|---|
getFont, postEvent |
| Constructor Detail |
|---|
public SimplePlot()
public SimplePlot(SimplePlot.Origin origin)
origin - the plot origin.| Method Detail |
|---|
public static SimplePlot asPoints(float[] f)
f - array of sampled function values f(x).
public static SimplePlot asPoints(Sampling s,
float[] f)
s - the sampling of the x coordinate.f - array of sampled function values f(x).
public static SimplePlot asPoints(float[] x,
float[] y)
x - array of x coordinates.y - array of y coordinates.
public static SimplePlot asSequence(float[] f)
f - array of sampled function values f(x).
public static SimplePlot asSequence(Sampling s,
float[] f)
s - the sampling of the x coordinate.f - array of sampled function values f(x).
public static SimplePlot asPixels(float[][] f)
f - array[n2][n1] of sampled function values f(x1,x2), where
n1 = f[0].length and n2 = f.length.
public static SimplePlot asPixels(Sampling s1,
Sampling s2,
float[][] f)
s1 - the sampling of the x1 coordinate.s2 - the sampling of the x2 coordinate.f - array[n2][n1] of sampled function values f(x1,x2), where
n1 = f[0].length and n2 = f.length.
public static SimplePlot asPoints(double[] f)
f - array of sampled function values f(x).
public static SimplePlot asPoints(Sampling s,
double[] f)
s - the sampling of the x coordinate.f - array of sampled function values f(x).
public static SimplePlot asPoints(double[] x,
double[] y)
x - array of x coordinates.y - array of y coordinates.
public static SimplePlot asSequence(double[] f)
f - array of sampled function values f(x).
public static SimplePlot asSequence(Sampling s,
double[] f)
s - the sampling of the x coordinate.f - array of sampled function values f(x).
public static SimplePlot asPixels(double[][] f)
f - array[n2][n1] of sampled function values f(x1,x2), where
n1 = f[0].length and n2 = f.length.
public static SimplePlot asPixels(Sampling s1,
Sampling s2,
double[][] f)
s1 - the sampling of the x1 coordinate.s2 - the sampling of the x2 coordinate.f - array[n2][n1] of sampled function values f(x1,x2), where
n1 = f[0].length and n2 = f.length.
public GridView addGrid()
public GridView addGrid(java.lang.String parameters)
GridView.setParameters(String).
parameters - the parameters string.
public PointsView addPoints(float[] f)
f - array of sampled function values f(x).
public PointsView addPoints(Sampling s,
float[] f)
s - the sampling of the x coordinate.f - array of sampled function values f(x).
public PointsView addPoints(float[] x,
float[] y)
x - array of x coordinates.y - array of y coordinates.
public PointsView addPoints(double[] f)
f - array of sampled function values f(x).
public PointsView addPoints(Sampling s,
double[] f)
s - the sampling of the x coordinate.f - array of sampled function values f(x).
public PointsView addPoints(double[] x,
double[] y)
x - array of x coordinates.y - array of y coordinates.
public SequenceView addSequence(float[] f)
f - array of sampled function values f(x).
public SequenceView addSequence(Sampling s,
float[] f)
s - the sampling of the variable x.f - array of sampled function values f(x).
public SequenceView addSequence(double[] f)
f - array of sampled function values f(x).
public SequenceView addSequence(Sampling s,
double[] f)
s - the sampling of the variable x.f - array of sampled function values f(x).
public PixelsView addPixels(float[][] f)
f - array[n2][n1] of sampled function values f(x1,x2), where
n1 = f[0].length and n2 = f.length.
public PixelsView addPixels(Sampling s1,
Sampling s2,
float[][] f)
s1 - the sampling of the variable x1; must be uniform.s2 - the sampling of the variable x2; must be uniform.f - array[n2][n1] of sampled function values f(x1,x2), where
n1 = f[0].length and n2 = f.length.
public PixelsView addPixels(double[][] f)
f - array[n2][n1] of sampled function values f(x1,x2), where
n1 = f[0].length and n2 = f.length.
public PixelsView addPixels(Sampling s1,
Sampling s2,
double[][] f)
s1 - the sampling of the variable x1; must be uniform.s2 - the sampling of the variable x2; must be uniform.f - array[n2][n1] of sampled function values f(x1,x2), where
n1 = f[0].length and n2 = f.length.
public ColorBar addColorBar()
public ColorBar addColorBar(java.lang.String label)
label - the label; null, if none.
public boolean add(TiledView tv)
tv - the tiled view.
public boolean remove(TiledView tv)
tv - the tiled view.
public void addTitle(java.lang.String title)
setTitle(String).
The title font is 1.5 times larger than the font of this plot.
title - the title; null, if none.public void setTitle(java.lang.String title)
addTitle(String).
setTitle in class java.awt.Frametitle - the title; null, for no title.public void removeTitle()
setTitle(String) with a null title.
public void setLimits(double hmin,
double vmin,
double hmax,
double vmax)
hmin - the minimum value.vmin - the minimum value.hmax - the maximum value.vmax - the maximum value.
public void setHLimits(double hmin,
double hmax)
hmin - the minimum value.hmax - the maximum value.
public void setVLimits(double vmin,
double vmax)
vmin - the minimum value.vmax - the maximum value.public void setLimitsDefault()
public void setHLimitsDefault()
public void setVLimitsDefault()
public void setHLabel(java.lang.String label)
label - the label.public void setVLabel(java.lang.String label)
label - the label.public void setHFormat(java.lang.String format)
format - the format.public void setVFormat(java.lang.String format)
format - the format.public PlotPanel getPlotPanel()
getPlotPanel in class PlotFrame
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||