public class ChartUtils
extends java.lang.Object
Constructor and Description |
---|
ChartUtils() |
Modifier and Type | Method and Description |
---|---|
static java.awt.image.BufferedImage |
createAttributeChartNominal(weka.core.Attribute summaryAtt,
java.lang.String attName,
java.io.OutputStream dos,
int width,
int height)
Creates and writes a combined chart for a nominal attribute given its
summary attribute information and an output stream to write to
|
static java.awt.image.BufferedImage |
createAttributeChartNumeric(NumericAttributeBinData binStats,
weka.core.Attribute summaryAtt,
java.io.OutputStream dos,
int width,
int height) |
static java.awt.Image |
getHeatMapForMatrix(weka.core.matrix.Matrix matrix,
java.util.List<java.lang.String> rowAttNames)
Generates a heat map from a matrix of correlations
|
static void |
main(java.lang.String[] args) |
static java.awt.image.BufferedImage |
renderBoxPlotFromSummaryData(int width,
int height,
java.util.List<java.lang.Double> summary,
java.util.List<java.lang.Double> outliers,
java.util.List<java.lang.String> additionalArgs)
Create a box plot buffered image from summary data (mean, median, q1, q3,
min, max, minOutlier, maxOutlier, list of outliers)
|
static java.awt.image.BufferedImage |
renderCombinedBoxPlotAndHistogramFromSummaryData(int width,
int height,
java.util.List<java.lang.String> bins,
java.util.List<java.lang.Double> freqs,
java.util.List<java.lang.Double> summary,
java.util.List<java.lang.Double> outliers,
java.util.List<java.lang.String> additionalArgs)
Render a combined histogram and box plot chart from summary data
|
static java.awt.image.BufferedImage |
renderCombinedPieAndHistogramFromSummaryData(int width,
int height,
java.util.List<java.lang.String> values,
java.util.List<java.lang.Double> freqs,
java.util.List<java.lang.String> additionalArgs)
Render a combined histogram and pie chart from summary data
|
static java.awt.image.BufferedImage |
renderHistogramFromSummaryData(int width,
int height,
java.util.List<java.lang.String> bins,
java.util.List<java.lang.Double> freqs,
java.util.List<java.lang.String> additionalArgs)
Render a histogram chart from summary data (i.e.
|
static java.awt.image.BufferedImage |
renderPieChartFromSummaryData(int width,
int height,
java.util.List<java.lang.String> values,
java.util.List<java.lang.Double> freqs,
boolean showLabels,
boolean showLegend,
java.util.List<java.lang.String> additionalArgs)
Render a pie chart from summary data (i.e.
|
static void |
writeImage(java.awt.image.BufferedImage image,
java.io.OutputStream dest)
Write a BufferedImage to a destination output stream as a png
|
public static java.awt.Image getHeatMapForMatrix(weka.core.matrix.Matrix matrix, java.util.List<java.lang.String> rowAttNames)
matrix
- a Matrix (expected to hold correlation values between -1 and
1)rowAttNames
- a list of labels for the columns/rowspublic static void writeImage(java.awt.image.BufferedImage image, java.io.OutputStream dest) throws java.io.IOException
image
- the image to writedest
- the destination output streamjava.io.IOException
- if a problem occurspublic static java.awt.image.BufferedImage renderHistogramFromSummaryData(int width, int height, java.util.List<java.lang.String> bins, java.util.List<java.lang.Double> freqs, java.util.List<java.lang.String> additionalArgs) throws java.lang.Exception
width
- the width of the resulting imageheight
- the height of the resulting imagebins
- the list of bin labelsfreqs
- the corresponding bin frequenciesadditionalArgs
- optional arguments to the renderer (may be null)java.lang.Exception
- if a problem occurspublic static java.awt.image.BufferedImage renderBoxPlotFromSummaryData(int width, int height, java.util.List<java.lang.Double> summary, java.util.List<java.lang.Double> outliers, java.util.List<java.lang.String> additionalArgs) throws java.lang.Exception
width
- the width of the resulting imageheight
- the height of the resulting imagesummary
- summary dataoutliers
- list of outlier valuesadditionalArgs
- additional options to the rendererjava.lang.Exception
- if a problem occurspublic static java.awt.image.BufferedImage renderPieChartFromSummaryData(int width, int height, java.util.List<java.lang.String> values, java.util.List<java.lang.Double> freqs, boolean showLabels, boolean showLegend, java.util.List<java.lang.String> additionalArgs) throws java.lang.Exception
width
- the width of the resulting imageheight
- the height of the resulting imagevalues
- a list of values for the chartfreqs
- a list of corresponding frequenciesshowLabels
- true if the chart will show labelsshowLegend
- true if the chart will show a legendadditionalArgs
- optional arguments to the renderer (may be null)java.lang.Exception
- if a problem occurspublic static java.awt.image.BufferedImage renderCombinedPieAndHistogramFromSummaryData(int width, int height, java.util.List<java.lang.String> values, java.util.List<java.lang.Double> freqs, java.util.List<java.lang.String> additionalArgs) throws java.lang.Exception
width
- the width of the resulting imageheight
- the height of the resulting imagevalues
- the values for the chartfreqs
- the corresponding frequenciesadditionalArgs
- optional arguments to the renderer (may be null)java.lang.Exception
- if a problem occurspublic static java.awt.image.BufferedImage renderCombinedBoxPlotAndHistogramFromSummaryData(int width, int height, java.util.List<java.lang.String> bins, java.util.List<java.lang.Double> freqs, java.util.List<java.lang.Double> summary, java.util.List<java.lang.Double> outliers, java.util.List<java.lang.String> additionalArgs) throws java.lang.Exception
width
- the width of the resulting imageheight
- the height of the resulting imagebins
- the values for the chartfreqs
- the corresponding frequenciessummary
- the summary stats for the box plotoutliers
- an optional list of outliers for the box plotadditionalArgs
- optional arguments to the renderer (may be null)java.lang.Exception
- if a problem occurspublic static java.awt.image.BufferedImage createAttributeChartNumeric(NumericAttributeBinData binStats, weka.core.Attribute summaryAtt, java.io.OutputStream dos, int width, int height) throws java.io.IOException
java.io.IOException
public static java.awt.image.BufferedImage createAttributeChartNominal(weka.core.Attribute summaryAtt, java.lang.String attName, java.io.OutputStream dos, int width, int height) throws java.io.IOException
summaryAtt
- the summary attribute for the attribute to processattName
- the name of the attributedos
- the output stream to write to (can be null for no write)width
- the width of the chartheight
- the height of the chartjava.io.IOException
- if a problem occurspublic static void main(java.lang.String[] args)