Example usage for org.jfree.data.xy YIntervalSeries setDescription

List of usage examples for org.jfree.data.xy YIntervalSeries setDescription

Introduction

In this page you can find the example usage for org.jfree.data.xy YIntervalSeries setDescription.

Prototype

public void setDescription(String description) 

Source Link

Document

Sets the description of the series and sends a PropertyChangeEvent to all registered listeners.

Usage

From source file:edu.scripps.fl.curves.plot.CurvePlot.java

protected YIntervalSeries getSeries(Map<Double, Collection<Double>> map, String description) {
    YIntervalSeries series = new YIntervalSeries(description);
    series.setDescription(description);
    for (Object o : map.keySet()) {
        SummaryStatistics stats = new SummaryStatistics();
        Collection<Double> values = (Collection<Double>) map.get(o);
        for (Double d : values)
            stats.addValue(d);/*from ww  w.ja v a 2s  .  c  o m*/
        double avg = stats.getMean();
        double stddev = stats.getStandardDeviation();
        //         System.out.println(String.format("Adding %e\t%.2f\t%.2f",o, avg, stddev));
        series.add((Double) o, avg, avg - stddev, avg + stddev);
    }
    return series;
}

From source file:edu.scripps.fl.curves.plot.CurvePlot.java

public void addCurveAllPoints(Curve curve, FitFunction fitFunction, String description) {
    double min = Double.MAX_VALUE, max = Double.MIN_VALUE;
    YIntervalSeries validSeries = new YIntervalSeries(description);
    validSeries.setDescription(description);
    YIntervalSeries invalidSeries = new YIntervalSeries("");
    for (int ii = 0; ii < curve.getConcentrations().size(); ii++) {
        Double c = curve.getConcentrations().get(ii);
        Double r = curve.getResponses().get(ii);
        if (curve.getMask().get(ii))
            validSeries.add(c, r, r, r);
        else/*from   w ww.j  a  v  a2s.co m*/
            invalidSeries.add(c, r, r, r);
        min = Math.min(min, c);
        max = Math.max(max, c);
    }
    addCurve(curve, validSeries, invalidSeries, fitFunction, min, max);
}

From source file:org.jfree.data.xy.YIntervalSeriesCollectionTest.java

/**
 * Confirm that cloning works./*from w w  w  .j a v a 2  s.c o m*/
 */
@Test
public void testCloning() throws CloneNotSupportedException {
    YIntervalSeriesCollection c1 = new YIntervalSeriesCollection();
    YIntervalSeries s1 = new YIntervalSeries("Series");
    s1.add(1.0, 1.1, 1.2, 1.3);
    c1.addSeries(s1);
    YIntervalSeriesCollection c2 = (YIntervalSeriesCollection) c1.clone();
    assertTrue(c1 != c2);
    assertTrue(c1.getClass() == c2.getClass());
    assertTrue(c1.equals(c2));

    // check independence
    s1.setDescription("XYZ");
    assertFalse(c1.equals(c2));
}

From source file:org.jfree.data.xy.junit.YIntervalSeriesCollectionTest.java

/**
 * Confirm that cloning works./*  w  w w.j av a2  s . c o  m*/
 */
public void testCloning() {
    YIntervalSeriesCollection c1 = new YIntervalSeriesCollection();
    YIntervalSeries s1 = new YIntervalSeries("Series");
    s1.add(1.0, 1.1, 1.2, 1.3);
    c1.addSeries(s1);
    YIntervalSeriesCollection c2 = null;
    try {
        c2 = (YIntervalSeriesCollection) c1.clone();
    } catch (CloneNotSupportedException e) {
        e.printStackTrace();
    }
    assertTrue(c1 != c2);
    assertTrue(c1.getClass() == c2.getClass());
    assertTrue(c1.equals(c2));

    // check independence
    s1.setDescription("XYZ");
    assertFalse(c1.equals(c2));
}