当前位置: 首页>>代码示例>>Java>>正文


Java HistogramType.FREQUENCY属性代码示例

本文整理汇总了Java中org.jfree.data.statistics.HistogramType.FREQUENCY属性的典型用法代码示例。如果您正苦于以下问题:Java HistogramType.FREQUENCY属性的具体用法?Java HistogramType.FREQUENCY怎么用?Java HistogramType.FREQUENCY使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.jfree.data.statistics.HistogramType的用法示例。


在下文中一共展示了HistogramType.FREQUENCY属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getY

/**
 * Returns the y-value for a bin
 * (calculated to take into account the histogram type).
 *
 * @param seriesIndex the series index (zero based)
 * @param binIndex    the bin index (zero based)
 * @return the y value
 */
public Number getY( int seriesIndex, int binIndex ) {

    PhetHistogramSeries series = getSeries( seriesIndex );
    final double totalObservations = series.getNumberOfObservations();
    final double binObservations = series.getNumberOfObservations( binIndex );
    final double binWidth = series.getBinWidth();

    double y = 0;
    if ( histogramType == HistogramType.FREQUENCY ) {
        y = binObservations;
    }
    else if ( histogramType == HistogramType.RELATIVE_FREQUENCY ) {
        y = binObservations / totalObservations;
    }
    else if ( histogramType == HistogramType.SCALE_AREA_TO_1 ) {
        y = binObservations / ( binWidth * totalObservations );
    }
    else {
        throw new IllegalStateException( "unsupported HistogramType: " + histogramType );
    }
    return new Double( y );
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:30,代码来源:PhetHistogramDataset.java

示例2: HistogramPlotDataset

public HistogramPlotDataset(PeakList peakList, RawDataFile[] rawDataFiles,
    int numOfBins, HistogramDataType dataType, Range<Double> range) {

this.list = new Vector<HashMap<?, ?>>();
this.type = HistogramType.FREQUENCY;
this.dataType = dataType;
this.peakList = peakList;
this.numOfBins = numOfBins;
this.rawDataFiles = rawDataFiles;

minimum = range.lowerEndpoint();
maximum = range.upperEndpoint();

updateHistogramDataset();

   }
 
开发者ID:mzmine,项目名称:mzmine2,代码行数:16,代码来源:HistogramPlotDataset.java

示例3: getY

/**
    * Returns the y-value for a bin (calculated to take into account the
    * histogram type).
    * 
    * @param series
    *            the series index (in the range <code>0</code> to
    *            <code>getSeriesCount() - 1</code>).
    * @param item
    *            the item index (zero based).
    * 
    * @return The y-value.
    * 
    * @throws IndexOutOfBoundsException
    *             if <code>series</code> is outside the specified range.
    */
   public Number getY(int series, int item) {
List<?> bins = getBins(series);
HistogramBin bin = (HistogramBin) bins.get(item);
double total = getTotal(series);
double binWidth = getBinWidth(series);

if (this.type == HistogramType.FREQUENCY) {
    return new Double(bin.getCount());
} else if (this.type == HistogramType.RELATIVE_FREQUENCY) {
    return new Double(bin.getCount() / total);
} else if (this.type == HistogramType.SCALE_AREA_TO_1) {
    return new Double(bin.getCount() / (binWidth * total));
} else { // pretty sure this shouldn't ever happen
    throw new IllegalStateException();
}
   }
 
开发者ID:mzmine,项目名称:mzmine2,代码行数:31,代码来源:HistogramPlotDataset.java

示例4: PhetHistogramDataset

/**
 * Creates an empty dataset of type HistogramType.FREQUENCY.
 */
public PhetHistogramDataset() {
    this( HistogramType.FREQUENCY );
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:6,代码来源:PhetHistogramDataset.java


注:本文中的org.jfree.data.statistics.HistogramType.FREQUENCY属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。