Package tech.tablesaw.plotly.traces
Class HistogramTrace.HistogramBuilder
- java.lang.Object
-
- tech.tablesaw.plotly.traces.TraceBuilder
-
- tech.tablesaw.plotly.traces.HistogramTrace.HistogramBuilder
-
- Enclosing class:
- HistogramTrace
public static class HistogramTrace.HistogramBuilder extends TraceBuilder
-
-
Field Summary
-
Fields inherited from class tech.tablesaw.plotly.traces.TraceBuilder
hoverLabel, ids, legendGroup, name, opacity, showLegend, visible, xAxis, yAxis
-
-
Method Summary
-
Methods inherited from class tech.tablesaw.plotly.traces.TraceBuilder
columnToStringArray, hoverLabel, legendGroup, visible
-
-
-
-
Method Detail
-
nBinsX
public HistogramTrace.HistogramBuilder nBinsX(int bins)
Specifies the maximum number of desired bins. This value will be used in an algorithm that will decide the optimal bin size such that the histogram best visualizes the distribution of the data.
-
nBinsY
public HistogramTrace.HistogramBuilder nBinsY(int bins)
-
autoBinX
public HistogramTrace.HistogramBuilder autoBinX(boolean autoBinX)
Determines whether or not the x axis bin attributes are picked by an algorithm. Note that this should be set to False if you want to manually set the number of bins using the attributes in xbins.Note also that this should be true (default) to use nbinsx to suggest a bin count
-
autoBinY
public HistogramTrace.HistogramBuilder autoBinY(boolean autoBinY)
-
marker
public HistogramTrace.HistogramBuilder marker(Marker marker)
-
opacity
public HistogramTrace.HistogramBuilder opacity(double opacity)
- Overrides:
opacity
in classTraceBuilder
-
horizontal
public HistogramTrace.HistogramBuilder horizontal(boolean horizontal)
-
showLegend
public HistogramTrace.HistogramBuilder showLegend(boolean b)
- Overrides:
showLegend
in classTraceBuilder
-
histNorm
public HistogramTrace.HistogramBuilder histNorm(HistogramTrace.HistNorm histNorm)
Specifies the type of normalization used for this histogram trace. If "", the span of each bar corresponds to the number of occurrences (i.e. the number of data points lying inside the bins). If "percent" / "probability", the span of each bar corresponds to the percentage / fraction of occurrences with respect to the total number of sample points (here, the sum of all bin HEIGHTS equals 100% / 1). If "density", the span of each bar corresponds to the number of occurrences in a bin divided by the size of the bin interval (here, the sum of all bin AREAS equals the total number of sample points). If "probability density", the area of each bar corresponds to the probability that an event will fall into the corresponding bin (here, the sum of all bin AREAS equals 1).- Parameters:
histNorm
- The normalization type for the histogram- Returns:
- This HistogramBuilder
-
histFunc
public HistogramTrace.HistogramBuilder histFunc(HistogramTrace.HistFunc histFunc)
Specifies the binning function used for this histogram trace. If "count", the histogram values are computed by counting the number of values lying inside each bin. If "sum", "avg", "min", "max", the histogram values are computed using the sum, the average, the minimum or the maximum of the values lying inside each bin respectively.- Parameters:
histFunc
- The function type- Returns:
- This HistogramBuilder
-
name
public HistogramTrace.HistogramBuilder name(String name)
- Overrides:
name
in classTraceBuilder
-
xAxis
public HistogramTrace.HistogramBuilder xAxis(String xAxis)
- Overrides:
xAxis
in classTraceBuilder
-
yAxis
public HistogramTrace.HistogramBuilder yAxis(String yAxis)
- Overrides:
yAxis
in classTraceBuilder
-
y
public HistogramTrace.HistogramBuilder y(double[] y)
-
y
public HistogramTrace.HistogramBuilder y(tech.tablesaw.api.NumericColumn<? extends Number> values)
-
build
public HistogramTrace build()
-
getType
protected String getType()
- Specified by:
getType
in classTraceBuilder
-
-