Example usage for org.jfree.chart.axis LogarithmicAxis LogarithmicAxis

List of usage examples for org.jfree.chart.axis LogarithmicAxis LogarithmicAxis

Introduction

In this page you can find the example usage for org.jfree.chart.axis LogarithmicAxis LogarithmicAxis.

Prototype

public LogarithmicAxis(String label) 

Source Link

Document

Creates a new axis.

Usage

From source file:org.yooreeka.util.gui.XyLogGui.java

public XyLogGui(String title, double[] x, double[] y) {

    super(title);

    errMsg = new StringBuilder();
    setLoopInt(x.length);/*from   w w w  .  j  a  va2 s .  co m*/

    if (checkX(x) && checkY(x.length, y)) {

        XYSeries xydata = new XYSeries(title);

        for (int i = 0; i < loopInt; i++) {

            if (x[i] == C.ZERO_DOUBLE || x[i] < 0) {
                x[i] = C.SMALL_DOUBLE;
            }

            if (y[i] == C.ZERO_DOUBLE || y[i] < 0) {
                y[i] = C.SMALL_DOUBLE;
            }

            xydata.add(x[i], y[i]);
        }

        xycollection = new XYSeriesCollection(xydata);

        final JFreeChart chart = ChartFactory.createXYLineChart(title + " (XY Plot)", "X", "Y", xycollection,
                PlotOrientation.VERTICAL, true, true, false);

        final XYPlot plot = chart.getXYPlot();

        final NumberAxis domainAxis = new NumberAxis("x");
        plot.setDomainAxis(domainAxis);

        final NumberAxis logRangeAxis = new LogarithmicAxis("Log(y)");
        plot.setRangeAxis(logRangeAxis);

        chart.setBackgroundPaint(Color.white);
        plot.setOutlinePaint(Color.black);

        final ChartPanel chartPanel = new ChartPanel(chart);
        chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));
        setContentPane(chartPanel);

    } else {
        System.err.println(errMsg.toString());
    }
}

From source file:umberto.WeightedClusterCoefficient.ChartUtils.java

public static void scaleLogarithmicChart(JFreeChart chart, XYSeries dSeries, boolean normalized) {
    XYPlot plot = (XYPlot) chart.getPlot();
    NumberAxis logxaxis = new LogarithmicAxis(plot.getDomainAxis().getLabel());
    NumberAxis logyaxis = new LogarithmicAxis(plot.getRangeAxis().getLabel());
    plot.setRangeAxis(logyaxis);//from   w w  w.  jav  a 2 s  .  co  m
    plot.setDomainAxis(logxaxis);
}

From source file:org.amanzi.awe.distribution.ui.widgets.DistributionChartWidget.java

public void updateChartType(final ChartType chartType) {
    final CategoryPlot plot = (CategoryPlot) distributionChart.getPlot();

    switch (chartType) {
    case LOGARITHMIC:
        final LogarithmicAxis logAxis = new LogarithmicAxis("Logarithmic");
        logAxis.setAllowNegativesFlag(true);
        plot.setRangeAxis(logAxis);//w  ww.  jav a 2 s  . c o m

        logAxis.setAutoRange(true);
        break;
    case COUNTS:
        final NumberAxis countAxis = new NumberAxis("Counts");
        countAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());

        plot.setRangeAxis(countAxis);
        countAxis.setAutoRange(true);
        break;
    case PERCENTS:
        final NumberAxis percentageAxis = new NumberAxis("Percentage");
        percentageAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
        percentageAxis.setRange(0, 100);

        plot.setRangeAxis(percentageAxis);
        break;
    }

    dataset.updateDelegate(chartType);

    update();
}

From source file:edu.gmu.cs.sim.util.media.chart.XYChartGenerator.java

protected void buildGlobalAttributes(LabelledList list) {

    // create the chart
    ((XYPlot) (chart.getPlot())).setDomainGridlinesVisible(false);
    ((XYPlot) (chart.getPlot())).setRangeGridlinesVisible(false);
    ((XYPlot) (chart.getPlot())).setDomainGridlinePaint(new Color(200, 200, 200));
    ((XYPlot) (chart.getPlot())).setRangeGridlinePaint(new Color(200, 200, 200));

    xLabel = new PropertyField() {
        public String newValue(String newValue) {
            setXAxisLabel(newValue);//www.j a va 2s . c om
            getChartPanel().repaint();
            return newValue;
        }
    };
    xLabel.setValue(getXAxisLabel());

    list.add(new JLabel("X Label"), xLabel);

    yLabel = new PropertyField() {
        public String newValue(String newValue) {
            setYAxisLabel(newValue);
            getChartPanel().repaint();
            return newValue;
        }
    };
    yLabel.setValue(getYAxisLabel());

    list.add(new JLabel("Y Label"), yLabel);

    xLog = new JCheckBox();
    xLog.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            if (xLog.isSelected()) {
                LogarithmicAxis logAxis = new LogarithmicAxis(xLabel.getValue());
                logAxis.setStrictValuesFlag(false);
                chart.getXYPlot().setDomainAxis(logAxis);
            } else {
                chart.getXYPlot().setDomainAxis(new NumberAxis(xLabel.getValue()));
            }
        }
    });

    yLog = new JCheckBox();
    yLog.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            if (yLog.isSelected()) {
                LogarithmicAxis logAxis = new LogarithmicAxis(yLabel.getValue());
                logAxis.setStrictValuesFlag(false);
                chart.getXYPlot().setRangeAxis(logAxis);
            } else {
                chart.getXYPlot().setRangeAxis(new NumberAxis(yLabel.getValue()));
            }
        }
    });

    Box box = Box.createHorizontalBox();
    box.add(new JLabel("X"));
    box.add(xLog);
    box.add(new JLabel(" Y"));
    box.add(yLog);
    box.add(Box.createGlue());
    list.add(new JLabel("Log Axis"), box);

    final JCheckBox xgridlines = new JCheckBox();
    xgridlines.setSelected(false);
    ItemListener il = new ItemListener() {
        public void itemStateChanged(ItemEvent e) {
            if (e.getStateChange() == ItemEvent.SELECTED) {
                chart.getXYPlot().setDomainGridlinesVisible(true);
            } else {
                chart.getXYPlot().setDomainGridlinesVisible(false);
            }
        }
    };
    xgridlines.addItemListener(il);

    final JCheckBox ygridlines = new JCheckBox();
    ygridlines.setSelected(false);
    il = new ItemListener() {
        public void itemStateChanged(ItemEvent e) {
            if (e.getStateChange() == ItemEvent.SELECTED) {
                chart.getXYPlot().setRangeGridlinesVisible(true);
            } else {
                chart.getXYPlot().setRangeGridlinesVisible(false);
            }
        }
    };
    ygridlines.addItemListener(il);

    box = Box.createHorizontalBox();
    box.add(new JLabel("X"));
    box.add(xgridlines);
    box.add(new JLabel(" Y"));
    box.add(ygridlines);
    box.add(Box.createGlue());
    list.add(new JLabel("Grid Lines"), box);
}

From source file:sim.util.media.chart.XYChartGenerator.java

protected void buildGlobalAttributes(LabelledList list) {

    // create the chart
    ((XYPlot) (chart.getPlot())).setDomainGridlinesVisible(false);
    ((XYPlot) (chart.getPlot())).setRangeGridlinesVisible(false);
    ((XYPlot) (chart.getPlot())).setDomainGridlinePaint(new Color(200, 200, 200));
    ((XYPlot) (chart.getPlot())).setRangeGridlinePaint(new Color(200, 200, 200));

    xLabel = new PropertyField() {
        public String newValue(String newValue) {
            setXAxisLabel(newValue);//www.j av a  2  s .com
            getChartPanel().repaint();
            return newValue;
        }
    };
    xLabel.setValue(getXAxisLabel());

    list.add(new JLabel("X Label"), xLabel);

    yLabel = new PropertyField() {
        public String newValue(String newValue) {
            setYAxisLabel(newValue);
            getChartPanel().repaint();
            return newValue;
        }
    };
    yLabel.setValue(getYAxisLabel());

    list.add(new JLabel("Y Label"), yLabel);

    xLog = new JCheckBox();
    xLog.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            if (xLog.isSelected()) {
                LogarithmicAxis logAxis = new LogarithmicAxis(xLabel.getValue());
                logAxis.setStrictValuesFlag(false);
                chart.getXYPlot().setDomainAxis(logAxis);
            } else
                chart.getXYPlot().setDomainAxis(new NumberAxis(xLabel.getValue()));
        }
    });

    yLog = new JCheckBox();
    yLog.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            if (yLog.isSelected()) {
                LogarithmicAxis logAxis = new LogarithmicAxis(yLabel.getValue());
                logAxis.setStrictValuesFlag(false);
                chart.getXYPlot().setRangeAxis(logAxis);
            } else
                chart.getXYPlot().setRangeAxis(new NumberAxis(yLabel.getValue()));
        }
    });

    Box box = Box.createHorizontalBox();
    box.add(new JLabel("X"));
    box.add(xLog);
    box.add(new JLabel(" Y"));
    box.add(yLog);
    box.add(Box.createGlue());
    list.add(new JLabel("Log Axis"), box);

    final JCheckBox xgridlines = new JCheckBox();
    xgridlines.setSelected(false);
    ItemListener il = new ItemListener() {
        public void itemStateChanged(ItemEvent e) {
            if (e.getStateChange() == ItemEvent.SELECTED) {
                chart.getXYPlot().setDomainGridlinesVisible(true);
            } else {
                chart.getXYPlot().setDomainGridlinesVisible(false);
            }
        }
    };
    xgridlines.addItemListener(il);

    final JCheckBox ygridlines = new JCheckBox();
    ygridlines.setSelected(false);
    il = new ItemListener() {
        public void itemStateChanged(ItemEvent e) {
            if (e.getStateChange() == ItemEvent.SELECTED) {
                chart.getXYPlot().setRangeGridlinesVisible(true);
            } else {
                chart.getXYPlot().setRangeGridlinesVisible(false);
            }
        }
    };
    ygridlines.addItemListener(il);

    box = Box.createHorizontalBox();
    box.add(new JLabel("X"));
    box.add(xgridlines);
    box.add(new JLabel(" Y"));
    box.add(ygridlines);
    box.add(Box.createGlue());
    list.add(new JLabel("Grid Lines"), box);
}

From source file:org.utgenome.core.cui.DrawHistogram.java

public void execute() throws Exception {

    InputStream in = null;//www .jav a  2 s  .  c  o m
    if ("-".equals(input)) {
        _logger.info("reading from STDIN");
        in = new StandardInputStream();
    } else {
        _logger.info("reading from " + input);
        in = new FileInputStream(input);
    }

    List<Double> data = new ArrayList<Double>();
    BufferedReader dataSetInput = new BufferedReader(new InputStreamReader(in));
    int lineCount = 1;
    try {
        // read data set
        boolean cutOffTail = !Double.isNaN(xMax);
        boolean cutOffHead = !Double.isNaN(xMin);
        for (String line; (line = dataSetInput.readLine()) != null; lineCount++) {

            if (lineCount % 100000 == 0)
                _logger.info(String.format("read %,d data points", lineCount));

            if (line.startsWith("#"))
                continue;
            double v = Double.parseDouble(line);
            if (cutOffTail && v > xMax)
                continue;
            if (cutOffHead && v < xMin)
                continue;

            data.add(v);
        }

        double[] value = new double[data.size()];
        for (int i = 0; i < data.size(); ++i) {
            value[i] = data.get(i);
        }

        // draw histogram
        HistogramDataset dataSet = new HistogramDataset();
        dataSet.setType(HistogramType.FREQUENCY);
        dataSet.addSeries("data", value, numBins);
        JFreeChart chart = ChartFactory.createHistogram(null, null, "Frequency", dataSet,
                PlotOrientation.VERTICAL, false, false, false);

        if (title != null) {
            chart.setTitle(title);
        }

        ValueAxis domainAxis = chart.getXYPlot().getDomainAxis();
        if (cutOffHead) {
            domainAxis.setLowerBound(xMin);
        }
        if (cutOffTail) {
            domainAxis.setUpperBound(xMax);
        }
        if (xLabel != null) {
            domainAxis.setLabel(xLabel);
        }

        if (yLog) {
            LogarithmicAxis logAxis = new LogarithmicAxis("Frequency");
            logAxis.setAllowNegativesFlag(true);
            logAxis.setAutoRangeIncludesZero(true);
            chart.getXYPlot().setRangeAxis(logAxis);
        }

        if (!Double.isNaN(yMin)) {
            chart.getXYPlot().getRangeAxis().setLowerBound(yMin);
        }
        if (!Double.isNaN(yMax)) {
            chart.getXYPlot().getRangeAxis().setUpperBound(yMax);
        }

        File outputFile = new File(output);
        _logger.info("output to " + outputFile);
        ChartUtilities.saveChartAsPNG(outputFile, chart, width, height);

    } catch (Exception e) {
        throw new Exception(String.format("error at line %d: %s", lineCount, e));
    }

}

From source file:com.jaxzin.iraf.forecast.swing.JForecaster.java

@SuppressWarnings({ "FieldRepeatedlyAccessedInMethod" })
private void customizeChart(final JFreeChart chart) {
    // Set the transparency of the histogram bars
    //        chart.getXYPlot().setForegroundAlpha(0.5f);
    // Lock the y-axis to 0.0->0.5

    // Customize the y-logAxis
    logAxis = new LogarithmicAxis("Account Value");
    logAxis.setAutoRange(true);//from  www. j  a va  2s.  c  om
    logAxis.setAllowNegativesFlag(true);
    logAxis.setNumberFormatOverride(NumberFormat.getCurrencyInstance());

    linearAxis = new NumberAxis("Account Value");
    linearAxis.setAutoRange(true);
    linearAxis.setNumberFormatOverride(NumberFormat.getCurrencyInstance());

    //noinspection ConditionalExpression
    chart.getXYPlot().setRangeAxis(controlPanel.isLogScale() ? logAxis : linearAxis);

    // Customize the legend (add title, reverse order, attach to right side)
    final BlockContainer legendWrap = new BlockContainer();
    final Block title = new LabelBlock("Percentiles");
    legendWrap.setArrangement(new ColumnArrangement());
    legendWrap.add(title);
    final LegendTitle legendTitle = new LegendTitle(new ReversedLegendItemSource(chart.getXYPlot()),
            new ColumnArrangement(), new ColumnArrangement());
    legendWrap.add(legendTitle);
    chart.getLegend().setWrapper(legendWrap);
    chart.getLegend().setPosition(RectangleEdge.RIGHT);

    // Customize the format of the tooltips
    chart.getXYPlot().getRenderer().setBaseToolTipGenerator(
            new StandardXYToolTipGenerator(StandardXYToolTipGenerator.DEFAULT_TOOL_TIP_FORMAT,
                    new SimpleDateFormat("yyyy"), NumberFormat.getCurrencyInstance()));
}

From source file:org.jfree.chart.demo.ContourPlotDemo.java

/**
 * Creates a ContourPlot chart./*  w ww  .  j ava2s  . c  o  m*/
 *
 * @return the chart.
 */
private JFreeChart createContourPlot() {

    final String title = "Contour Plot";
    final String xAxisLabel = "X Values";
    final String yAxisLabel = "Y Values";
    final String zAxisLabel = "Color Values";

    if (xIsDate) {
        this.xAxis = new DateAxis(xAxisLabel);
        xIsLog = false; // force axis to be linear when displaying dates
    } else {
        if (xIsLog) {
            this.xAxis = new LogarithmicAxis(xAxisLabel);
        } else {
            this.xAxis = new NumberAxis(xAxisLabel);
        }
    }

    if (yIsLog) {
        this.yAxis = new LogarithmicAxis(yAxisLabel);
    } else {
        this.yAxis = new NumberAxis(yAxisLabel);
    }

    if (zIsLog) {
        this.zColorBar = new ColorBar(zAxisLabel);
    } else {
        this.zColorBar = new ColorBar(zAxisLabel);
    }

    if (this.xAxis instanceof NumberAxis) {
        ((NumberAxis) this.xAxis).setAutoRangeIncludesZero(false);
        ((NumberAxis) this.xAxis).setInverted(xIsInverted);
    }

    this.yAxis.setAutoRangeIncludesZero(false);

    this.yAxis.setInverted(yIsInverted);

    if (!xIsDate) {
        ((NumberAxis) this.xAxis).setLowerMargin(0.0);
        ((NumberAxis) this.xAxis).setUpperMargin(0.0);
    }

    this.yAxis.setLowerMargin(0.0);
    this.yAxis.setUpperMargin(0.0);

    this.zColorBar.getAxis().setInverted(zIsInverted);
    this.zColorBar.getAxis().setTickMarksVisible(true);

    final ContourDataset data = createDataset();

    final ContourPlot plot = new ContourPlot(data, this.xAxis, this.yAxis, this.zColorBar);

    if (xIsDate) {
        ratio = Math.abs(ratio); // don't use plot units for ratios when x axis is date
    }
    plot.setDataAreaRatio(ratio);

    final JFreeChart chart = new JFreeChart(title, null, plot, false);
    chart.setBackgroundPaint(new GradientPaint(0, 0, Color.white, 0, 1000, Color.green));

    return chart;

}

From source file:org.jfree.chart.demo.ContourPlotDemo2.java

/**
 * Creates a ContourPlot chart./* w ww  .j  ava  2s  .  co  m*/
 *
 * @return the ContourPlot chart.
 */
private JFreeChart createContourPlot() {

    final String title = "Contour Plot";
    final String xAxisLabel = "X Values";
    final String yAxisLabel = "Y Values";
    final String zAxisLabel = "Color Values";

    if (xIsDate) {
        this.xAxis = new DateAxis(xAxisLabel);
        xIsLog = false; // force axis to be linear when displaying dates
    } else {
        if (xIsLog) {
            this.xAxis = new LogarithmicAxis(xAxisLabel);
        } else {
            this.xAxis = new NumberAxis(xAxisLabel);
        }
    }

    if (yIsLog) {
        this.yAxis = new LogarithmicAxis(yAxisLabel);
    } else {
        this.yAxis = new NumberAxis(yAxisLabel);
    }

    if (zIsLog) {
        this.zColorBar = new ColorBar(zAxisLabel);
    } else {
        this.zColorBar = new ColorBar(zAxisLabel);
    }

    if (this.xAxis instanceof NumberAxis) {
        ((NumberAxis) this.xAxis).setAutoRangeIncludesZero(false);
        ((NumberAxis) this.xAxis).setInverted(xIsInverted);
    }

    this.yAxis.setAutoRangeIncludesZero(false);

    this.yAxis.setInverted(yIsInverted);

    if (!xIsDate) {
        ((NumberAxis) this.xAxis).setLowerMargin(0.0);
        ((NumberAxis) this.xAxis).setUpperMargin(0.0);
    }

    this.yAxis.setLowerMargin(0.0);
    this.yAxis.setUpperMargin(0.0);

    if (!xIsDate) {
        this.xAxis.setRange(10.5, 15.0);
    }
    this.yAxis.setRange(3.5, 7.0);

    this.zColorBar.getAxis().setInverted(zIsInverted);
    this.zColorBar.getAxis().setTickMarksVisible(true);

    final ContourDataset data = createDataset();

    final ContourPlot plot = new ContourPlot(data, this.xAxis, this.yAxis, this.zColorBar);

    if (xIsDate) {
        ratio = Math.abs(ratio); // don't use plot units for ratios when x axis is date
    }

    if (asPoints) {
        plot.setRenderAsPoints(true);
    }
    plot.setDataAreaRatio(ratio);

    if (annotate) {
        if (asPoints) {
            final Number[] xValues = data.getXValues();
            final Number[] yValues = data.getYValues();
            //Number[] zValues = data.getZValues();

            final Font font = new Font("SansSerif", Font.PLAIN, 20);

            for (int i = 0; i < xValues.length; i++) {
                final XYTextAnnotation xyAnn = new XYTextAnnotation(Integer.toString(i),
                        xValues[i].doubleValue(), yValues[i].doubleValue());
                xyAnn.setFont(font);
                plot.addAnnotation(xyAnn);
            }
        } else {
            final Font font = new Font("SansSerif", Font.PLAIN, 20);

            for (int i = 0; i < this.tmpDoubleX.length; i++) {
                final XYTextAnnotation xyAnn = new XYTextAnnotation(Integer.toString(i), this.tmpDoubleX[i],
                        this.tmpDoubleY[i]);
                xyAnn.setFont(font);
                plot.addAnnotation(xyAnn);
            }
        }

    }

    if (fillOutline || drawOutline) {
        initShoreline();
        plot.setClipPath(new ClipPath(this.xOutline, this.yOutline, true, fillOutline, drawOutline));
    }

    final JFreeChart chart = new JFreeChart(title, null, plot, false);

    // then customise it a little...
    chart.setBackgroundPaint(new GradientPaint(0, 0, Color.white, 0, 1000, Color.green));

    return chart;

}

From source file:org.matsim.counts.algorithms.graphs.CountsSimRealPerHourGraph.java

/**
 * @param hour A value in 1..24, 1 for 0 a.m. to 1 a.m., 2 for 1 a.m. to 2 a.m. ...
 *//*w  w  w.ja  v a  2  s  .  c o m*/
@Override
public JFreeChart createChart(final int hour) {
    this.hour = hour;

    XYSeriesCollection dataset0 = new XYSeriesCollection();
    XYSeries series = new XYSeries("MATSim volumes");
    // easier to use another dataset
    XYSeriesCollection dataset_outliers = new XYSeriesCollection();
    XYSeries series_outliers = new XYSeries("MATSim outliers");

    CustomXYURLGenerator url_gen = new CustomXYURLGenerator();
    CustomXYToolTipGenerator tt_gen = new CustomXYToolTipGenerator();

    final ArrayList<String> urls = new ArrayList<String>();
    final ArrayList<String> tooltips = new ArrayList<String>();
    List<Comp> comps = new Vector<Comp>();

    Iterator<CountSimComparison> l_it = this.ccl_.iterator();
    //int elementCounter=0;
    while (l_it.hasNext()) {
        CountSimComparison cc = l_it.next();

        /* values with simVal==0.0 or countVal==0.0 are drawn on the x==1 or/and y==1-line
         * Such values are the result of a poor simulation run, but they can also represent 
         * a valid result (closing summer road during winter time)
         * 
         */
        if (cc.getHour() == hour) {
            //elementCounter++;
            double realVal = 1.0;
            double simVal = 1.0;
            if (cc.getCountValue() > 0.0 && cc.getSimulationValue() > 0.0) {
                realVal = cc.getCountValue();
                simVal = cc.getSimulationValue();
                series.add(realVal, simVal);
                comps.add(new Comp(realVal, "link" + cc.getId() + ".html",
                        "Link " + cc.getId() + "; " + "Count: " + realVal + ", Sim: " + simVal));
            } else {
                realVal = Math.max(1.0, cc.getCountValue());
                simVal = Math.max(1.0, cc.getSimulationValue());
                series_outliers.add(realVal, simVal);
            }

        } //if
    } //while
    dataset0.addSeries(series);
    dataset_outliers.addSeries(series_outliers);

    /* first we have to sort the vector according to the rendering ordering
    * (which is the x value).
    * REALLY??? After hours of searching no better solution found!
    * please help!
    */

    Collections.sort(comps, new MyComparator());

    for (Iterator<Comp> iter = comps.iterator(); iter.hasNext();) {
        Comp cp = iter.next();
        urls.add(cp.getURL());
        tooltips.add(cp.getTooltip());
    }

    url_gen.addURLSeries(urls);
    tt_gen.addToolTipSeries(tooltips);

    String title = "Volumes " + (hour - 1) + ":00 - " + (hour) + ":00, Iteration: " + this.iteration_;
    this.setChartTitle(title);
    this.chart_ = ChartFactory.createXYLineChart(title, "Count Volumes [veh/h]", // x axis label
            "Sim Volumes [veh/h]", // y axis label
            dataset0, // data
            PlotOrientation.VERTICAL, false, // include legend
            true, // tooltips
            true // urls
    );
    XYPlot plot = this.chart_.getXYPlot();
    final LogarithmicAxis axis_x = new LogarithmicAxis("Count Volumes [veh/h]");
    final LogarithmicAxis axis_y = new LogarithmicAxis("Sim Volumes [veh/h]");
    axis_x.setAllowNegativesFlag(false);
    axis_y.setAllowNegativesFlag(false);

    //regular values
    XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
    renderer.setLinesVisible(false);
    renderer.setURLGenerator(url_gen);
    renderer.setSeriesPaint(0, Color.black);
    renderer.setSeriesToolTipGenerator(0, tt_gen);
    renderer.setSeriesShape(0, new Rectangle2D.Double(-1.5, -1.5, 3.0, 3.0));

    //outliers
    XYLineAndShapeRenderer renderer2 = new XYLineAndShapeRenderer();
    renderer2.setLinesVisible(false);
    renderer2.setSeriesPaint(0, Color.red);
    renderer2.setSeriesShape(0, new Ellipse2D.Double(-3.0, -3.0, 6.0, 6.0));

    // error band
    DefaultXYDataset dataset1 = new DefaultXYDataset();
    dataset1.addSeries("f1x", new double[][] { { 1.0, 10000.0 }, { 1.0, 10000.0 } });
    dataset1.addSeries("f2x", new double[][] { { 1.0, 10000.0 }, { 2.0, 20000.0 } });
    dataset1.addSeries("f05x", new double[][] { { 2.0, 10000.0 }, { 1.0, 5000.0 } });

    XYLineAndShapeRenderer renderer3 = new XYLineAndShapeRenderer();
    renderer3.setShapesVisible(false);
    renderer3.setSeriesPaint(0, Color.blue);
    renderer3.setSeriesPaint(1, Color.blue);
    renderer3.setSeriesPaint(2, Color.blue);
    renderer3.setBaseSeriesVisibleInLegend(false);
    renderer3.setSeriesItemLabelsVisible(0, true);
    renderer3.setSeriesItemLabelsVisible(1, false);
    renderer3.setSeriesItemLabelsVisible(2, false);

    XYTextAnnotation annotation0 = new XYTextAnnotation("2.0 count", 12000.0, 15500.0);
    annotation0.setFont(new Font("SansSerif", Font.BOLD, 11));
    plot.addAnnotation(annotation0);
    XYTextAnnotation annotation1 = new XYTextAnnotation("count", 13000.0, 10000.0);
    annotation1.setFont(new Font("SansSerif", Font.BOLD, 11));
    plot.addAnnotation(annotation1);
    XYTextAnnotation annotation2 = new XYTextAnnotation("0.5 count", 11000.0, 3500.0);
    annotation2.setFont(new Font("SansSerif", Font.BOLD, 11));
    plot.addAnnotation(annotation2);

    plot.setDomainAxis(axis_x);
    plot.setRangeAxis(axis_y);
    plot.setRenderer(0, renderer);

    plot.setRenderer(1, renderer2);
    plot.setDataset(1, dataset_outliers);

    plot.setRenderer(2, renderer3);
    plot.setDataset(2, dataset1);

    plot.getRangeAxis().setRange(1.0, 19000.0);
    plot.getDomainAxis().setRange(1.0, 19000.0);

    return this.chart_;
}