Class SNTChart
- All Implemented Interfaces:
ActionListener,MouseListener,MouseMotionListener,ImageObserver,MenuContainer,Printable,Serializable,EventListener,Accessible,org.jfree.chart.event.ChartChangeListener,org.jfree.chart.event.ChartProgressListener,org.jfree.chart.event.OverlayChangeListener
ChartPanel modified for scientific publications and
convenience methods for plot annotations.- Author:
- Tiago Ferreira
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanelNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
Fields inherited from class org.jfree.chart.ChartPanel
COPY_COMMAND, DEFAULT_BUFFER_USED, DEFAULT_HEIGHT, DEFAULT_MAXIMUM_DRAW_HEIGHT, DEFAULT_MAXIMUM_DRAW_WIDTH, DEFAULT_MINIMUM_DRAW_HEIGHT, DEFAULT_MINIMUM_DRAW_WIDTH, DEFAULT_WIDTH, DEFAULT_ZOOM_TRIGGER_DISTANCE, localizationResources, PRINT_COMMAND, PROPERTIES_COMMAND, SAVE_COMMAND, ZOOM_IN_BOTH_COMMAND, ZOOM_IN_DOMAIN_COMMAND, ZOOM_IN_RANGE_COMMAND, ZOOM_OUT_BOTH_COMMAND, ZOOM_OUT_DOMAIN_COMMAND, ZOOM_OUT_RANGE_COMMAND, ZOOM_RESET_BOTH_COMMAND, ZOOM_RESET_DOMAIN_COMMAND, ZOOM_RESET_RANGE_COMMANDFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHFields inherited from interface java.awt.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected -
Method Summary
Modifier and TypeMethodDescriptionvoidaddColorBarLegend(String title, net.imglib2.display.ColorTable colorTable, double min, double max, int nDecimalPlaces) Adds a color bar legend (LUT ramp).voidaddPolygon(net.imglib2.roi.geom.real.Polygon2D poly, String lineColor, String fillColor) voidaddPolygon(net.imglib2.roi.geom.real.Polygon2D poly, org.scijava.util.ColorRGB lineColor, org.scijava.util.ColorRGB fillColor) voidAdds a subtitle to the chart.voidAdds a subtitle to the chart.voidannotateCategory(String category, String label) Annotates the specified category (Category plots only)voidannotateCategory(String category, String label, String color) Annotates the specified category (Category plots only).voidannotatePoint(double[] coordinates, String label, String color) Highlights a point in a histogram/XY plot by drawing a labeled arrow at the specified location.voidannotatePoint(double x, double y, String label) Highlights a point in a histogram/XY plot by drawing a labeled arrow at the specified location.voidannotatePoint(double x, double y, String label, String color) Highlights a point in a histogram/XY plot by drawing a labeled arrow at the specified location.voidannotateXline(double xValue, String label) Annotates the specified X-value (XY plots and histograms).voidannotateXline(double xValue, String label, String color) Annotates the specified X-value (XY plots and histograms).voidannotateYline(double yValue, String label) Annotates the specified Y-value (XY plots and histograms).voidannotateYline(double yValue, String label, String color) Annotates the specified Y-value (XY plots and histograms).voidapplyStyle(SNTChart template) static voidcloseAll()Closes all open chartsstatic SNTChartcombine(Collection<SNTChart> charts) Combines a collection of charts into a multipanel montage.static SNTChartcombine(Collection<SNTChart> charts, boolean labelPanels) Combines a collection of charts into a multipanel montage.static SNTChartcombine(Collection<SNTChart> charts, int rows, int cols, boolean labelPanels) Combines a collection of charts into a multipanel montage.static SNTChartcombine(Collection<SNTChart> charts, String commonTitle, int rows, int cols, boolean labelPanels) Combines a collection of charts into a multipanel montage.static ij.ImagePluscombineAsImagePlus(Collection<SNTChart> charts) Combines a collection of charts into a ImageJ1 stack.booleanChecks if the chart contains valid data.voiddispose()Disposes of this chart and releases its resources.protected voidexportAsCSV(File file) getFrame()static SNTChartgetHistogram(SNTTable table, boolean polar) static SNTChartgetHistogram(SNTTable table, int[] columnIndices, boolean polar) Creates a histogram from the given table.static SNTChartgetHistogram(SNTTable table, Collection<String> columnHeaders, boolean polar) Creates a histogram from the given table.ij.ImagePlusgetImage()Gets an ImagePlus representation of the chart.List<ij.ImagePlus> getImages(float scalingFactor) static org.jfree.chart.title.PaintScaleLegendgetPaintScaleLegend(String title, net.imglib2.display.ColorTable colorTable, double min, double max, int nDecimalPlaces) getTitle()booleanChecks if this chart is part of a multi-panel montagebooleanChecks if the axes of the underlying XY plot are equalized.booleanGets whether the GMM distribution curve is being overlaid over histogram frequenciesbooleanbooleanbooleanGets whether a normal distribution curve is being overlaid over histogram frequenciesbooleanChecks if the plot outline is visible.booleanGets whether quartile markers (Q1, Median, Q3) are being overlaid over histogram frequenciesstatic voidvoidReplaces the current chart with the specified instancebooleanSaves this chart.booleanSaves this chart.voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidsetAxesVisible(boolean visible) Sets the visibility of chart axes.voidsetChartTitle(String title) void(Re)colors existing dataset seriesvoidsetColors(net.imglib2.display.ColorTable colorTable) (Re)colors existing dataset seriesstatic voidsetDefaultFontScale(double scalingFactor) voidsetEqualizeAxes(boolean equalize) Sets whether the axes of the underlying XY plot should be equalized (same scale).voidsetFontSize(float size) Sets the font size to all components of this chart.voidsetFontSize(float size, String scope) Sets the font size for this chart.voidsetGaussianFitVisible(boolean visible) Sets whether a normal distribution curve should be overlaid over histogram frequencies.voidsetGMMFitVisible(boolean visible) Sets whether a GMM distribution curve should be overlaid over histogram frequencies.voidsetGridlinesVisible(boolean visible) voidsetLegendVisible(boolean visible) voidsetLineWidth(int width) Changes the line width of all series in a XY plotvoidsetOutlineVisible(boolean visible) Sets the visibility of the plot outline.voidsetQuartilesVisible(boolean visible) Sets whether quartile markers (Q1, Median, Q3) should be overlaid over histogram frequencies.voidvoidsetVisible(boolean b) Deprecated.voidshow()voidshow(int width, int height) Shows this chart on a dedicated framevoidstatic voidshowHeatmap(double[][] data, net.imglib2.display.ColorTable colorTable, String... axisLabels) Shows a two-dimensional heatmap from a two-dimensional data matrix.static voidshowHeatmap(Collection<Double> values1, Collection<Double> values2, net.imglib2.display.ColorTable colorTable, String... axisLabels) Shows a two-dimensional heatmap for a two-dimensional data matrix assembled from two collectionsstatic voidshowHistogram3D(double[][] data, net.imglib2.display.ColorTable colorTable, boolean prob, String... axisLabels) Shows a bivariate histogram (two-dimensional histogram) from a matrix.static voidshowHistogram3D(Collection<Double> values1, Collection<Double> values2, net.imglib2.display.ColorTable colorTable, String... axisLabels) Shows a bivariate histogram (two-dimensional histogram) from two collections of values.static voidshowHistogram3D(org.apache.commons.math3.stat.descriptive.DescriptiveStatistics stats1, org.apache.commons.math3.stat.descriptive.DescriptiveStatistics stats2, net.imglib2.display.ColorTable colorTable, String... axisLabels) Shows a bivariate histogram (two-dimensional histogram) from two DescriptiveStatistics objects.static voidtile(Collection<SNTChart> charts) Tiles specified charts displaying them on a grid.static voidtileAll()Tiles all open charts displaying them on a grid.Methods inherited from class org.jfree.chart.ChartPanel
actionPerformed, addChartMouseListener, addOverlay, chartChanged, chartProgress, createChartPrintJob, createPopupMenu, createPopupMenu, displayPopupMenu, doCopy, doEditChartProperties, doSaveAs, getAnchor, getChart, getChartRenderingInfo, getDismissDelay, getEntityForPoint, getFillZoomRectangle, getHorizontalAxisTrace, getHorizontalTraceLine, getInitialDelay, getListeners, getMaximumDrawHeight, getMaximumDrawWidth, getMinimumDrawHeight, getMinimumDrawWidth, getPopupMenu, getRefreshBuffer, getReshowDelay, getScaleX, getScaleY, getScreenDataArea, getScreenDataArea, getToolTipText, getVerticalAxisTrace, getVerticalTraceLine, getZoomAroundAnchor, getZoomFillPaint, getZoomInFactor, getZoomOutFactor, getZoomOutlinePaint, getZoomTriggerDistance, isDomainZoomable, isEnforceFileExtensions, isMouseWheelEnabled, isRangeZoomable, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, overlayChanged, paintChartToBuffer, paintComponent, print, removeChartMouseListener, removeOverlay, restoreAutoBounds, restoreAutoDomainBounds, restoreAutoRangeBounds, scale, setAnchor, setChart, setDefaultDirectoryForSaveAs, setDismissDelay, setDisplayToolTips, setDomainZoomable, setEnforceFileExtensions, setFillZoomRectangle, setHorizontalAxisTrace, setHorizontalTraceLine, setInitialDelay, setMaximumDrawHeight, setMaximumDrawWidth, setMinimumDrawHeight, setMinimumDrawWidth, setMouseWheelEnabled, setMouseZoomable, setMouseZoomable, setPopupMenu, setRangeZoomable, setRefreshBuffer, setReshowDelay, setVerticalAxisTrace, setVerticalTraceLine, setZoomAroundAnchor, setZoomFillPaint, setZoomInFactor, setZoomOutFactor, setZoomOutlinePaint, setZoomTriggerDistance, translateJava2DToScreen, translateScreenToJava2D, updateUI, zoom, zoomInBoth, zoomInDomain, zoomInRange, zoomOutBoth, zoomOutDomain, zoomOutRangeMethods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUIMethods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, updateMethods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeMethods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Constructor Details
-
SNTChart
-
SNTChart
-
SNTChart
-
SNTChart
-
-
Method Details
-
getFrame
-
annotateXline
Annotates the specified X-value (XY plots and histograms).- Parameters:
xValue- the X value to be annotated.label- the annotation label
-
annotateXline
Annotates the specified X-value (XY plots and histograms).- Parameters:
xValue- the X value to be annotated.label- the annotation labelcolor- the font color
-
annotateYline
Annotates the specified Y-value (XY plots and histograms).- Parameters:
yValue- the Y value to be annotated.label- the annotation label
-
annotateYline
Annotates the specified Y-value (XY plots and histograms).- Parameters:
yValue- the Y value to be annotated.label- the annotation labelcolor- the font color
-
setAxesVisible
public void setAxesVisible(boolean visible) Sets the visibility of chart axes.Controls whether the domain (X) and range (Y) axes are visible in the chart. This affects both XY plots and category plots.
- Parameters:
visible- true to show axes, false to hide them
-
isLegendVisible
public boolean isLegendVisible() -
isOutlineVisible
public boolean isOutlineVisible()Checks if the plot outline is visible.Returns true if the plot's border outline is currently visible.
- Returns:
- true if outline is visible, false otherwise
-
isGridlinesVisible
public boolean isGridlinesVisible() -
setGridlinesVisible
public void setGridlinesVisible(boolean visible) -
setOutlineVisible
public void setOutlineVisible(boolean visible) Sets the visibility of the plot outline.Controls whether the border outline around the plot area is visible.
- Parameters:
visible- true to show outline, false to hide it
-
setEqualizeAxes
public void setEqualizeAxes(boolean equalize) Sets whether the axes of the underlying XY plot should be equalized (same scale).When enabled, both X and Y axes will use the same scale to maintain equal aspect ratio. When disabled, each axis maximizes its range.
- Parameters:
equalize- true to equalize axes, false otherwise- Throws:
IllegalArgumentException- if the underlying plot is not a XY plot
-
isEqualized
public boolean isEqualized()Checks if the axes of the underlying XY plot are equalized.Returns true if both X and Y axes use the same scale.
- Returns:
- true if axes are equalized, false otherwise
-
setLegendVisible
public void setLegendVisible(boolean visible) -
annotateCategory
Annotates the specified category (Category plots only)- Parameters:
category- the category to be annotated. Ignored if it does not exist in category axis.label- the annotation label
-
annotateCategory
Annotates the specified category (Category plots only).- Parameters:
category- the category to be annotated. Ignored if it does not exist in category axis.label- the annotation labelcolor- the annotation color
-
setColors
(Re)colors existing dataset series- Parameters:
colors- The series colors
-
setColors
public void setColors(net.imglib2.display.ColorTable colorTable) (Re)colors existing dataset series- Parameters:
colorTable- The colorTable used to recolor series
-
setLineWidth
public void setLineWidth(int width) Changes the line width of all series in a XY plot- Parameters:
width- the stroke width- Throws:
IllegalArgumentException- if this SNChart is not an XYPlot
-
setChartTitle
-
replace
Replaces the current chart with the specified instance- Parameters:
other- the instance replacing current contents
-
setFontSize
public void setFontSize(float size) Sets the font size to all components of this chart.- Parameters:
size- the new font size
-
setFontSize
Sets the font size for this chart.- Parameters:
size- the new font sizescope- which components should be modified. Either "axes", "legends", or "labels" (singular/plural allowed)
-
getImage
public ij.ImagePlus getImage()Gets an ImagePlus representation of the chart.Creates an ImagePlus object containing a rasterized version of the chart at default scaling (1.0x).
- Returns:
- an ImagePlus containing the chart image
-
getImages
-
setTitle
-
getTitle
-
save
Saves this chart.- Parameters:
file- the output file (null not permitted). The extension of its filename (".svg", ".png", ".pdf"), determines the file format- Returns:
- true if file was successfully saved, false otherwise
-
save
Saves this chart.- Parameters:
filePath- the path of the output file (null not permitted). Its filename extension (".svg", ".png", ".pdf"), determines the file format.- Returns:
- true if file was successfully saved, false otherwise
-
saveAsPNG
- Throws:
IOException
-
saveAsPNG
- Throws:
IOException
-
saveAsPNG
- Throws:
IOException
-
saveAsPNG
- Throws:
IOException
-
saveAsPDF
- Throws:
IOException
-
saveAsPDF
- Throws:
IOException
-
saveAsPDF
- Throws:
IOException
-
saveAsSVG
- Throws:
IOException
-
saveAsSVG
- Throws:
IOException
-
saveAsSVG
- Throws:
IOException
-
applyStyle
-
addPolygon
-
addPolygon
public void addPolygon(net.imglib2.roi.geom.real.Polygon2D poly, org.scijava.util.ColorRGB lineColor, org.scijava.util.ColorRGB fillColor) -
annotate
Adds a subtitle to the chart.- Parameters:
label- the subtitle text
-
annotate
Adds a subtitle to the chart.- Parameters:
label- the subtitle texttooltip- the tooltip text.nullpermittedalignment- either 'left', 'center', or 'right'
-
annotatePoint
Highlights a point in a histogram/XY plot by drawing a labeled arrow at the specified location.- Parameters:
x- the x-coordinatey- the y-coordinatelabel- the annotation label
-
annotatePoint
Highlights a point in a histogram/XY plot by drawing a labeled arrow at the specified location.- Parameters:
x- the x-coordinatey- the y-coordinatelabel- the annotation labelcolor- the annotation color
-
annotatePoint
Highlights a point in a histogram/XY plot by drawing a labeled arrow at the specified location.- Parameters:
coordinates- the array holding the focal point coordinates of the profilelabel- the annotation labelcolor- the annotation color
-
getDefaultDirectoryForSaveAs
- Overrides:
getDefaultDirectoryForSaveAsin classorg.jfree.chart.ChartPanel
-
show
public void show(int width, int height) Shows this chart on a dedicated frame- Parameters:
width- the preferred frame widthheight- the preferred frame height
-
dispose
public void dispose()Disposes of this chart and releases its resources.Closes the chart window and removes it from the list of open instances. This method should be called when the chart is no longer needed to prevent memory leaks.
-
containsValidData
public boolean containsValidData()Checks if the chart contains valid data.Returns true if the chart object exists and presumably contains data that can be displayed.
- Returns:
- whether chart contains valid Data
-
setGaussianFitVisible
public void setGaussianFitVisible(boolean visible) Sets whether a normal distribution curve should be overlaid over histogram frequencies.- Parameters:
visible- whether curve should be displayed. Ignored if current chart is not a histogram
-
setGMMFitVisible
public void setGMMFitVisible(boolean visible) Sets whether a GMM distribution curve should be overlaid over histogram frequencies.- Parameters:
visible- whether curve should be displayed. Ignored if current chart is not a histogram
-
isQuartilesVisible
public boolean isQuartilesVisible()Gets whether quartile markers (Q1, Median, Q3) are being overlaid over histogram frequencies- Returns:
- true if current chart is a histogram with overlaid quartile markers
-
setQuartilesVisible
public void setQuartilesVisible(boolean visible) Sets whether quartile markers (Q1, Median, Q3) should be overlaid over histogram frequencies.- Parameters:
visible- whether markers should be displayed. Ignored if current chart is not a histogram
-
isNormDistributionVisible
public boolean isNormDistributionVisible()Gets whether a normal distribution curve is being overlaid over histogram frequencies- Returns:
- true if current chart is a histogram with overlaid normal curve
-
isGMMDistributionVisible
public boolean isGMMDistributionVisible()Gets whether the GMM distribution curve is being overlaid over histogram frequencies- Returns:
- true if current chart is a histogram with overlaid GMM curve
-
setVisible
Deprecated.- Overrides:
setVisiblein classJComponent
-
show
public void show() -
show
-
exportAsCSV
- Throws:
IllegalStateException
-
isCombined
public boolean isCombined()Checks if this chart is part of a multi-panel montage- Returns:
- true, if is combined
-
addColorBarLegend
public void addColorBarLegend(String title, net.imglib2.display.ColorTable colorTable, double min, double max, int nDecimalPlaces) Adds a color bar legend (LUT ramp).- Parameters:
title- the color bar labelcolorTable- the color tablemin- the minimum value in the color tablemax- the maximum value in the color tablenDecimalPlaces- the number of decimal places in the legend labels
-
getPaintScaleLegend
public static org.jfree.chart.title.PaintScaleLegend getPaintScaleLegend(String title, net.imglib2.display.ColorTable colorTable, double min, double max, int nDecimalPlaces) -
openCharts
- Returns:
- a list of all opened charts
-
closeAll
public static void closeAll()Closes all open charts -
tileAll
public static void tileAll()Tiles all open charts displaying them on a grid. Charts's windows are made visible if not displayed. -
tile
Tiles specified charts displaying them on a grid. Charts's windows are made visible if not displayed.- Parameters:
charts- the charts to be tiled
-
combineAsImagePlus
Combines a collection of charts into a ImageJ1 stack.- Parameters:
charts- input charts- Returns:
- the stack as an ImagePlus (RGB)
-
combine
Combines a collection of charts into a multipanel montage. Number of rows and columns is automatically determined.- Parameters:
charts- input charts- Returns:
- the frame containing the montage.
-
combine
Combines a collection of charts into a multipanel montage. Number of rows and columns is automatically determined.- Parameters:
charts- input chartslabelPanels- whether each panel in the montage should be labeled- Returns:
- the frame containing the montage.
-
combine
public static SNTChart combine(Collection<SNTChart> charts, int rows, int cols, boolean labelPanels) Combines a collection of charts into a multipanel montage.- Parameters:
charts- input chartsrows- the number of rows in the montagecols- the number of columns in the montagelabelPanels- whether each panel in the montage should be labeled- Returns:
- the frame containing the montage
-
combine
public static SNTChart combine(Collection<SNTChart> charts, String commonTitle, int rows, int cols, boolean labelPanels) Combines a collection of charts into a multipanel montage.- Parameters:
charts- input chartscommonTitle- Common title for the montagerows- the number of rows in the montagecols- the number of columns in the montagelabelPanels- whether each panel in the montage should be labeled- Returns:
- the frame containing the montage
-
showHistogram3D
public static void showHistogram3D(double[][] data, net.imglib2.display.ColorTable colorTable, boolean prob, String... axisLabels) throws InterruptedException, InvocationTargetException Shows a bivariate histogram (two-dimensional histogram) from a matrix. The number of bins is automatically determined using the Freedman-Diaconis rule.- Parameters:
data- the matrix holding the two distributions to be plottedcolorTable- the color table (LUT) used to color histogram bars (null allowed)prob- Whether frequencies should be normalized to probabilitiesaxisLabels- Labels for the axes (optional)- Throws:
InterruptedException- if the histogram cannot be displayedInvocationTargetException- if the histogram cannot be displayed
-
showHeatmap
public static void showHeatmap(double[][] data, net.imglib2.display.ColorTable colorTable, String... axisLabels) throws InterruptedException, InvocationTargetException Shows a two-dimensional heatmap from a two-dimensional data matrix.- Parameters:
data- the two-dimensional matrix holding the data to be plottedcolorTable- the heatmap color table (LUT) (null not allowed)axisLabels- Labels for the axes (optional)- Throws:
InterruptedException- if the heatmap cannot be displayedInvocationTargetException- if the heatmap cannot be displayed
-
showHistogram3D
public static void showHistogram3D(Collection<Double> values1, Collection<Double> values2, net.imglib2.display.ColorTable colorTable, String... axisLabels) throws InterruptedException, InvocationTargetException Shows a bivariate histogram (two-dimensional histogram) from two collections of values. The number of bins is automatically determined using the Freedman-Diaconis rule.- Parameters:
values1- the values of the first distribution to be plottedvalues2- the values of the second distribution to be plottedcolorTable- the color table (LUT) used to color histogram bars (null allowed)axisLabels- Labels for the axes (optional)- Throws:
InterruptedException- if the histogram cannot be displayedInvocationTargetException- if the histogram cannot be displayed
-
showHeatmap
public static void showHeatmap(Collection<Double> values1, Collection<Double> values2, net.imglib2.display.ColorTable colorTable, String... axisLabels) throws InterruptedException, InvocationTargetException Shows a two-dimensional heatmap for a two-dimensional data matrix assembled from two collections- Parameters:
values1- the values of the first matrix columnvalues2- the values of the second matrix columncolorTable- the heatmap color table (LUT) (null not allowed)axisLabels- Labels for the axes (optional)- Throws:
InterruptedException- if the heatmap cannot be displayedInvocationTargetException- if the heatmap cannot be displayed
-
showHistogram3D
public static void showHistogram3D(org.apache.commons.math3.stat.descriptive.DescriptiveStatistics stats1, org.apache.commons.math3.stat.descriptive.DescriptiveStatistics stats2, net.imglib2.display.ColorTable colorTable, String... axisLabels) throws InterruptedException, InvocationTargetException Shows a bivariate histogram (two-dimensional histogram) from two DescriptiveStatistics objects. The number of bins is automatically determined using the Freedman-Diaconis rule.- Parameters:
stats1- DescriptiveStatistics for the first distributionstats2- DescriptiveStatistics for the second distributioncolorTable- the color table (LUT) used to color histogram bars (Null allowed)axisLabels- Labels for the axes (optional)- Throws:
InterruptedException- if the histogram cannot be displayedInvocationTargetException- if the histogram cannot be displayed
-
setDefaultFontScale
public static void setDefaultFontScale(double scalingFactor) -
getHistogram
public static SNTChart getHistogram(SNTTable table, Collection<String> columnHeaders, boolean polar) Creates a histogram from the given table. The number of bins is automatically determined using the Freedman-Diaconis rule.- Parameters:
table- the table holding the data to be plottedcolumnHeaders- the headers of the columns to be plotted (case-sensitive)polar- whether the histogram should be polar. Data expected in degrees ]0, 360]- Returns:
- the histogram chart
-
getHistogram
Creates a histogram from the given table. The number of bins is automatically determined using the Freedman-Diaconis rule.- Parameters:
table- the table holding the data to be plottedcolumnIndices- the indices (0-based) of the columns to be plottedpolar- whether the histogram should be polar. Data expected in degrees ]0, 360]- Returns:
- the histogram chart
-
getHistogram
-
main
-