當前位置: 首頁>>代碼示例>>Java>>正文


Java XYSeries類代碼示例

本文整理匯總了Java中org.jfree.data.xy.XYSeries的典型用法代碼示例。如果您正苦於以下問題:Java XYSeries類的具體用法?Java XYSeries怎麽用?Java XYSeries使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


XYSeries類屬於org.jfree.data.xy包,在下文中一共展示了XYSeries類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: writeROCCurves

import org.jfree.data.xy.XYSeries; //導入依賴的package包/類
public static void writeROCCurves(File outputFile, TreeMap<String, HitStatistic> hits) throws Exception{

		XYSeriesCollection dataset = new XYSeriesCollection();
		
		for(Entry<String, HitStatistic> e:hits.entrySet()){
			File txtFile=new File(outputFile.getAbsolutePath().replaceAll(".jpg","_"+e.getKey().split("-")[2]+".txt"));
			BufferedWriter bw=new BufferedWriter(new FileWriter(txtFile));
			XYSeries series= new XYSeries(e.getKey());
			bw.write("false positive rate\tsensitivity");
			bw.newLine();
			List<double[]> roc=e.getValue().getROCAverage();
			for(double[] r:roc){
				bw.write(r[0]+"\t"+r[1]);
				bw.newLine();
				series.add(r[0],r[1]);
			}
			dataset.addSeries(series);
			bw.close();
		}
		
		
		final JFreeChart chart =ChartFactory.createXYLineChart("ROCCurve",  "false positive rate", "sensitivity", dataset);
		ChartUtilities.saveChartAsJPEG(outputFile, chart, 1000, 400);
	}
 
開發者ID:boecker-lab,項目名稱:passatuto,代碼行數:25,代碼來源:HitStatistic.java

示例2: addSeries

import org.jfree.data.xy.XYSeries; //導入依賴的package包/類
private void addSeries(double[][] data,String[] seriesLabel,int xcolumn,Paint[] color){
    int length = data.length;
    int numberOfSeries = data[0].length-1;
    //int currentSize = seriesColor.size();
    
    for (int j = 0; j < numberOfSeries+1; j++) {
        XYSeriesCollection seriesCollection = new XYSeriesCollection();
        XYSeries series = new XYSeries(seriesLabel[0],false);
        if(j==xcolumn)
            continue;
        else{
            seriesColor.add(color[(j>=xcolumn)?j-1:j]);
            
            for(int i=0;i<length;i++){
                series.add( data[i][xcolumn], data[i][j] ,false);
            }
            seriesCollection.addSeries(series);
        }
        dataset.add(seriesCollection);
    }
}
 
開發者ID:PacktPublishing,項目名稱:Neural-Network-Programming-with-Java-SecondEdition,代碼行數:22,代碼來源:Chart.java

示例3: createXYDataset1

import org.jfree.data.xy.XYSeries; //導入依賴的package包/類
/**
 * Creates a dataset for testing.
 * 
 * @return A dataset.
 */
private XYDataset createXYDataset1() {
    XYSeries series1 = new XYSeries("S1");
    series1.add(1.0, 100.0);
    series1.add(2.0, 101.0);
    series1.add(3.0, 102.0);
    XYSeries series2 = new XYSeries("S2");
    series2.add(1.0, 103.0);
    series2.add(2.0, null);
    series2.add(3.0, 105.0);
    XYSeriesCollection result = new XYSeriesCollection();
    result.addSeries(series1);
    result.addSeries(series2);
    result.setIntervalWidth(0.0);
    return result;
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:21,代碼來源:DatasetUtilitiesTests.java

示例4: getSamplingIntervalMilliSeconds

import org.jfree.data.xy.XYSeries; //導入依賴的package包/類
/**
 * Gets the sampling interval in milliseconds.
 *
 * @param series the series
 * @param from the sampling interval offset start value
 * @param to the the sampling interval offset end value
 * @return the sampling interval
 */
private double getSamplingIntervalMilliSeconds(XYSeries series, int from, int to){
	double samplingInterval = this.getSimulationDurationMilliSeconds();
	
	if(to > series.getItemCount()-1 || to < 0){
		to = series.getItemCount()-1;
	}
	
	if(!(from < to)){
		from = to;
	}
	
	if(this.threadInfoStorage != null && series.getItemCount() > from){
		Number start = series.getX(from); //first value
		Number end   = series.getX(to); //last value
		samplingInterval = end.doubleValue() - start.doubleValue();
	}
	return samplingInterval;
}
 
開發者ID:EnFlexIT,項目名稱:AgentWorkbench,代碼行數:27,代碼來源:ThreadCalculateMetrics.java

示例5: createTableXYDataset1

import org.jfree.data.xy.XYSeries; //導入依賴的package包/類
/**
 * Creates a sample dataset for testing purposes.
 * 
 * @return A sample dataset.
 */
private TableXYDataset createTableXYDataset1() {
    DefaultTableXYDataset dataset = new DefaultTableXYDataset();
    
    XYSeries s1 = new XYSeries("Series 1", true, false);
    s1.add(1.0, 1.0);
    s1.add(2.0, 2.0);
    dataset.addSeries(s1);
    
    XYSeries s2 = new XYSeries("Series 2", true, false);
    s2.add(1.0, -2.0);
    s2.add(2.0, -1.0);
    dataset.addSeries(s2);
    
    return dataset;  
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:21,代碼來源:DatasetUtilitiesTests.java

示例6: fillToXYSeriesPriv

import org.jfree.data.xy.XYSeries; //導入依賴的package包/類
protected void fillToXYSeriesPriv(XYSeries series, float[] spectrum){
	series.clear();
	/**
	 * caching decreases GC usage
	 */
	boolean useCached	= false;
	if (!useCached){
		for (int i = 0; i < spectrum.length; i++)
		{
			double freq = (freqStartHz + fftBinSizeHz * i) / 1000000;
			series.add(freq, spectrum[i]);
		}
	}
	else{
		ArrayList<XYDataItem> items	= cachedDataItems.get(cachedDataItemsIndex);
		for (int i = 0; i < spectrum.length; i++)
		{
			XYDataItem item	= items.get(i);
			item.setY(spectrum[i]);
			series.add(item);
		}
		cachedDataItemsIndex	= (cachedDataItemsIndex+1)%cachedDataItems.size();
	}
}
 
開發者ID:pavsa,項目名稱:hackrf-spectrum-analyzer,代碼行數:25,代碼來源:DatasetSpectrum.java

示例7: createNumericalDataSet

import org.jfree.data.xy.XYSeries; //導入依賴的package包/類
private XYDataset createNumericalDataSet() {
	XYSeriesCollection dataSet = new XYSeriesCollection();
	int translatedPlotColumn = translateToModelColumn(plotColumn);
	double start = model.getLowerBound(translatedPlotColumn);
	double end = model.getUpperBound(translatedPlotColumn);
	double stepSize = (end - start) / (NUMBER_OF_STEPS - 1);
	for (int classIndex : model.getClassIndices()) {
		XYSeries series = new XYSeries(model.getClassName(classIndex));
		ContinuousDistribution distribution = (ContinuousDistribution) model.getDistribution(classIndex,
				translatedPlotColumn);
		for (double currentValue = start; currentValue < end; currentValue += stepSize) {
			double probability = distribution.getProbability(currentValue);
			if (!Double.isNaN(probability)) {
				series.add(currentValue, distribution.getProbability(currentValue));
			}
		}
		dataSet.addSeries(series);
	}
	return dataSet;
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:21,代碼來源:DistributionPlotter.java

示例8: generateThroughputPerformChart

import org.jfree.data.xy.XYSeries; //導入依賴的package包/類
public static void generateThroughputPerformChart(String dbName,long performBatchId){
	String path=getChartRootPath(dbName+"_ThroughputPerform");
	System.out.println(path);
    XYSeries values = new XYSeries(dbName);
    List<Map<String, Object>> list = BizDBUtils.selectListBySqlAndParam("select success_times,timeout_avg  from ts_timeout_perform where  perform_batch_id=? and load_type=99",performBatchId);
    if(list!=null&&list.size()>0){
    	for(int i=0;i<list.size();i++){
    		Map<String, Object> map = list.get(i);
    		double timeout=((Number)map.get("timeout_avg")).doubleValue();
    		double successTimes=((Number)map.get("success_times")).doubleValue();
    		if(successTimes==0){
    			values.add(i+1,0);
    		}else{
    			values.add(i+1,successTimes*(TimeUnit.SECONDS.toMicros(1)/timeout));
    		}
    	}
    }
    XYSeriesCollection mCollection = new XYSeriesCollection();
    mCollection.addSeries(values);
    JFreeChart mChart= createXYLineChart("數據吞吐量折線圖", "請求次數","吞吐量(requests/sec)",mCollection);
    //saveAsFile(mChart,path, 1200, 800);
    saveAsFile(mChart,path, 2400, 800);
    
}
 
開發者ID:dbiir,項目名稱:ts-benchmark,代碼行數:25,代碼來源:ChartBizUtil.java

示例9: layerRaster

import org.jfree.data.xy.XYSeries; //導入依賴的package包/類
public XYPlot layerRaster(Collection<Spike> spikes,Layer lay)
    {
//        throw new UnsupportedOperationException("This is broken for now!");
        
        // Add the data
        Iterator<Spike> itr=spikes.iterator();
        XYSeries data=new XYSeries("Events");
        for (int i=0; i<spikes.size(); i++)
        {   Spike evt=itr.next();
            if (evt.layer==lay.ixLayer)
                data.add((float)evt.time/1000,evt.addr);
        }
        XYDataset raster = new XYSeriesCollection(data);
        
        //SamplingXYLineAndShapeRenderer renderer = new SamplingXYLineAndShapeRenderer(false, true);
        XYDotRenderer renderer = new XYDotRenderer();
        renderer.setDotWidth(2);
        renderer.setDotHeight(5);

        return new XYPlot(raster, null, new NumberAxis("Layer "+lay.ixLayer), renderer);
        
    }
 
開發者ID:SensorsINI,項目名稱:jaer,代碼行數:23,代碼來源:NetPlotter.java

示例10: createDataset

import org.jfree.data.xy.XYSeries; //導入依賴的package包/類
protected XYDataset createDataset(BufferedImage img) {
    CalculadorDeHistograma calculadorDePixel = new CalculadorDeHistograma();
    calculadorDePixel.calculaHistogramas(img);

    int[] qtdPixelsR = calculadorDePixel.getHistogramaR();
    int[] qtdPixelsG = calculadorDePixel.getHistogramaG();
    int[] qtdPixelsB = calculadorDePixel.getHistogramaB();

    final XYSeries linhaR = new XYSeries("R");
    final XYSeries linhaG = new XYSeries("G");
    final XYSeries linhaB = new XYSeries("B");

    for (int i = 0; i < qtdPixelsR.length; i++) {
        linhaR.add(i, qtdPixelsR[i]);
        linhaG.add(i, qtdPixelsG[i]);
        linhaB.add(i, qtdPixelsB[i]);
    }

    final XYSeriesCollection dataset = new XYSeriesCollection();
    dataset.addSeries(linhaR);
    dataset.addSeries(linhaB);
    dataset.addSeries(linhaG);

    return dataset;

}
 
開發者ID:nbfontana,項目名稱:pdi,代碼行數:27,代碼來源:Interface.java

示例11: crearFicheroXMLTRealLlegadaVictimas

import org.jfree.data.xy.XYSeries; //導入依賴的package包/類
@Override
  public void crearFicheroXMLTRealLlegadaVictimas(String name) throws Exception{
  	
  	seriesTRLlegadaVictimas = new XYSeries("Notification Time");
  	
  	try {
	  PrintWriter xml = new PrintWriter(
			            new FileOutputStream(name));			  
	  this.ficheroXMLTRealLlegadaVictimas = xml;
	  
	  this.ficheroXMLTRealLlegadaVictimas.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
	  this.ficheroXMLTRealLlegadaVictimas.println("<sequence>");			  			  			  
} catch (FileNotFoundException e) {
	e.printStackTrace();
}    	
  }
 
開發者ID:Yarichi,項目名稱:Proyecto-DASI,代碼行數:17,代碼來源:ClaseGeneradoraRecursoEstadistica.java

示例12: testEquals

import org.jfree.data.xy.XYSeries; //導入依賴的package包/類
/**
 * Confirm that the equals method can distinguish all the required fields.
 */
public void testEquals() {
    
    XYSeries s1 = new XYSeries("Series");
    s1.add(1.0, 1.1);
    XYSeries s2 = new XYSeries("Series");
    s2.add(1.0, 1.1);
    assertTrue(s1.equals(s2));
    assertTrue(s2.equals(s1));

    s1.setKey("Series X");
    assertFalse(s1.equals(s2));

    s2.setKey("Series X");
    assertTrue(s1.equals(s2));

}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:20,代碼來源:XYSeriesTests.java

示例13: createChart

import org.jfree.data.xy.XYSeries; //導入依賴的package包/類
/**
 * Create a horizontal bar chart with sample data in the range -3 to +3.
 *
 * @return the chart.
 */
private static JFreeChart createChart() {

    // create a dataset...
    XYSeries series1 = new XYSeries("Series 1");
    series1.add(1.0, 1.0);
    series1.add(2.0, 2.0);
    series1.add(3.0, 3.0);
    XYDataset dataset = new XYSeriesCollection(series1);

    // create the chart...
    return ChartFactory.createScatterPlot(
        "Scatter Plot",  // chart title
        "Domain",
        "Range",
        dataset,         // data
        PlotOrientation.VERTICAL,
        true,            // include legend
        true,            // tooltips
        false            // urls
    );

}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:28,代碼來源:ScatterPlotTests.java

示例14: GenerateModel

import org.jfree.data.xy.XYSeries; //導入依賴的package包/類
public void GenerateModel() throws IOException {

        XYPointCollection points = new XYPointCollection();
        XYSeries series = new XYSeries("Peptide ions");
        XYSeriesCollection xySeriesCollection = new XYSeriesCollection();

        for (PepIonID pepA : LCMSA.GetPepIonList().values()) {
            if (LCMSB.GetPepIonList().containsKey(pepA.GetKey())) {
                PepIonID pepB = LCMSB.GetPepIonList().get(pepA.GetKey());
                points.AddPoint(pepA.GetRT(), pepB.GetRT());
                series.add(new XYDataItem(pepA.GetRT(), pepB.GetRT()));
            }
        }
        regression = new PiecewiseRegression(parameter.MaxCurveRTRange, parameter.MaxCurveRTRange);
        regression.SetData(points);
        float R2 = regression.GetR2();
        Logger.getRootLogger().info("Retention time prediction model:(" + FilenameUtils.getBaseName(LCMSA.mzXMLFileName) + "-" + FilenameUtils.getBaseName(LCMSB.mzXMLFileName) + ")..R2=" + R2 + "(No. of commonly identified peptide ions=" + points.PointCount() + ")");

        GenerateRTMapPNG(xySeriesCollection, series, R2);
    }
 
開發者ID:YcheCourseProject,項目名稱:DIA-Umpire-Maven,代碼行數:21,代碼來源:RTAlignedPepIonMapping.java

示例15: createDataset2

import org.jfree.data.xy.XYSeries; //導入依賴的package包/類
/**
 * Creates a sample dataset.
 *
 * @return Series 2.
 */
private XYDataset createDataset2() {

    // create dataset 2...
    XYSeries series2 = new XYSeries("Series 3");

    series2.add(10.0, 16853.2);
    series2.add(20.0, 19642.3);
    series2.add(30.0, 18253.5);
    series2.add(40.0, 15352.3);
    series2.add(50.0, 13532.0);
    series2.add(100.0, 12635.3);
    series2.add(110.0, 13998.2);
    series2.add(120.0, 11943.2);
    series2.add(130.0, 16943.9);
    series2.add(140.0, 17843.2);
    series2.add(150.0, 16495.3);
    series2.add(160.0, 17943.6);
    series2.add(170.0, 18500.7);
    series2.add(180.0, 19595.9);

    return new XYSeriesCollection(series2);

}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:29,代碼來源:CombinedDomainXYPlotTests.java


注:本文中的org.jfree.data.xy.XYSeries類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。