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


Java XYItemRenderer.setSeriesShape方法代碼示例

本文整理匯總了Java中org.jfree.chart.renderer.xy.XYItemRenderer.setSeriesShape方法的典型用法代碼示例。如果您正苦於以下問題:Java XYItemRenderer.setSeriesShape方法的具體用法?Java XYItemRenderer.setSeriesShape怎麽用?Java XYItemRenderer.setSeriesShape使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.jfree.chart.renderer.xy.XYItemRenderer的用法示例。


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

示例1: GenerateRTMapPNG

import org.jfree.chart.renderer.xy.XYItemRenderer; //導入方法依賴的package包/類
private void GenerateRTMapPNG(XYSeriesCollection xySeriesCollection, XYSeries series, float R2) throws IOException {
    new File(Workfolder + "/RT_Mapping/").mkdir();
    String pngfile = Workfolder + "/RT_Mapping/" + FilenameUtils.getBaseName(LCMSA.mzXMLFileName).substring(0, Math.min(120, FilenameUtils.getBaseName(LCMSA.mzXMLFileName).length() - 1)) + "_" + FilenameUtils.getBaseName(LCMSB.mzXMLFileName).substring(0, Math.min(120, FilenameUtils.getBaseName(LCMSB.mzXMLFileName).length() - 1)) + "_RT.png";

    XYSeries smoothline = new XYSeries("RT fitting curve");
    for (XYZData data : regression.PredictYList) {
        smoothline.add(data.getX(), data.getY());
    }
    xySeriesCollection.addSeries(smoothline);
    xySeriesCollection.addSeries(series);
    JFreeChart chart = ChartFactory.createScatterPlot("Retention time mapping: R2=" + R2, "RT:" + FilenameUtils.getBaseName(LCMSA.mzXMLFileName), "RT:" + FilenameUtils.getBaseName(LCMSB.mzXMLFileName), xySeriesCollection,
            PlotOrientation.VERTICAL, true, true, false);
    XYPlot xyPlot = (XYPlot) chart.getPlot();
    xyPlot.setDomainCrosshairVisible(true);
    xyPlot.setRangeCrosshairVisible(true);

    XYItemRenderer renderer = xyPlot.getRenderer();
    renderer.setSeriesPaint(1, Color.blue);
    renderer.setSeriesPaint(0, Color.BLACK);
    renderer.setSeriesShape(1, new Ellipse2D.Double(0, 0, 3, 3));
    renderer.setSeriesStroke(1, new BasicStroke(3.0f));
    renderer.setSeriesStroke(0, new BasicStroke(3.0f));
    xyPlot.setBackgroundPaint(Color.white);
    ChartUtilities.saveChartAsPNG(new File(pngfile), chart, 1000, 600);
}
 
開發者ID:YcheCourseProject,項目名稱:DIA-Umpire-Maven,代碼行數:26,代碼來源:RTAlignedPepIonMapping.java

示例2: updateChart

import org.jfree.chart.renderer.xy.XYItemRenderer; //導入方法依賴的package包/類
public void updateChart(double[] data) {

		this.removeAll();
		this.revalidate();

		series = new XYSeries("XYGraph");
		for(int i=0; i<data.length;i++){
			if(data[i]>-1){
				series.add(5*i , data[i]/255 );
			}
		}

		dataset = new XYSeriesCollection();
		dataset.addSeries(series);


		chart = ChartFactory.createScatterPlot(
				null, // Title
				"ω [rad/s]", // x-axis Label
				"Q / Qmax", // y-axis Label
				dataset, // Dataset
				PlotOrientation.VERTICAL, 
				false, // Show Legend
				true, // Use tooltips
				false // Configure chart to generate URLs?
				);
		XYPlot plot = (XYPlot) chart.getPlot();
		plot.setBackgroundPaint( Color.WHITE );

		XYItemRenderer renderer = plot.getRenderer();
		renderer.setSeriesPaint(0, Color.RED);
		double delta = 2.0;
		Shape shape1 = new Rectangle2D.Double(-delta, -delta, delta, delta);
		renderer.setSeriesShape(0, shape1);

		ValueAxis yAxis = plot.getRangeAxis();
		yAxis.setRange(0, 1.1);
		ValueAxis xAxis = plot.getDomainAxis();
		xAxis.setRange(0, 2000);

		ChartPanel cp = new ChartPanel(chart);
		cp.setBackground(Color.WHITE);

		this.setLayout(new BorderLayout());
		this.add(cp, BorderLayout.CENTER);
		this.repaint();

	}
 
開發者ID:Tosbert,項目名稱:FizeauExperimentSimulation,代碼行數:49,代碼來源:GraphPanel.java

示例3: GenerateRTMapPNG

import org.jfree.chart.renderer.xy.XYItemRenderer; //導入方法依賴的package包/類
private void GenerateRTMapPNG(XYSeriesCollection xySeriesCollection, XYSeries series, float R2) throws IOException {
    String pngfile = FilenameUtils.getFullPath(TargetLCMS.mzXMLFileName) + "/" + FilenameUtils.getBaseName(TargetLCMS.mzXMLFileName) + "_" + libManager.LibID + "_RTMap.png";
    FileWriter writer = new FileWriter(FilenameUtils.getFullPath(TargetLCMS.mzXMLFileName) + "/" + FilenameUtils.getBaseName(TargetLCMS.mzXMLFileName) + "_" + libManager.LibID + "_RTMap.txt");

    XYSeries smoothline = new XYSeries("RT fitting curve");
    for (XYZData data : regression.PredictYList) {
        smoothline.add(data.getX(), data.getY());
        writer.write(data.getX() + "\t" + data.getY() + "\n");
    }
    writer.close();
    xySeriesCollection.addSeries(smoothline);
    xySeriesCollection.addSeries(series);
    JFreeChart chart = ChartFactory.createScatterPlot("Retention time mapping: R2=" + R2, "Normalized RT (" + libManager.LibID + ")", "RT:" + FilenameUtils.getBaseName(TargetLCMS.mzXMLFileName), xySeriesCollection,
            PlotOrientation.VERTICAL, true, true, false);
    XYPlot xyPlot = (XYPlot) chart.getPlot();
    xyPlot.setDomainCrosshairVisible(true);
    xyPlot.setRangeCrosshairVisible(true);

    XYItemRenderer renderer = xyPlot.getRenderer();
    renderer.setSeriesPaint(1, Color.blue);
    renderer.setSeriesPaint(0, Color.BLACK);
    renderer.setSeriesShape(1, new Ellipse2D.Double(0, 0, 3, 3));
    renderer.setSeriesStroke(1, new BasicStroke(3.0f));
    renderer.setSeriesStroke(0, new BasicStroke(3.0f));
    xyPlot.setBackgroundPaint(Color.white);
    ChartUtilities.saveChartAsPNG(new File(pngfile), chart, 1000, 600);
}
 
開發者ID:YcheCourseProject,項目名稱:DIA-Umpire-Maven,代碼行數:28,代碼來源:RTMappingExtLib.java

示例4: copyNumberCDF

import org.jfree.chart.renderer.xy.XYItemRenderer; //導入方法依賴的package包/類
@NotNull
static JFreeChart copyNumberCDF(@NotNull final List<PurpleCopyNumber> copyNumbers) {
    final XYDataset dataset = CopyNumberCharts.createDataset(copyNumbers);
    JFreeChart chart =
            ChartFactory.createScatterPlot("Copy Number CDF", "BAF Weighting (CDF)", "Ploidy", dataset, PlotOrientation.VERTICAL, false,
                    false, false);
    XYPlot xyPlot = (XYPlot) chart.getPlot();
    XYItemRenderer renderer = ((XYPlot) chart.getPlot()).getRenderer();
    Shape shape = new Ellipse2D.Double(0, 0, 4, 4);
    renderer.setSeriesShape(0, shape);
    renderer.setSeriesPaint(0, Color.blue);
    xyPlot.getRangeAxis().setRange(0, 10);
    return chart;
}
 
開發者ID:hartwigmedical,項目名稱:hmftools,代碼行數:15,代碼來源:CopyNumberCharts.java

示例5: GenerateMassCalibrationRTMap

import org.jfree.chart.renderer.xy.XYItemRenderer; //導入方法依賴的package包/類
public void GenerateMassCalibrationRTMap() throws IOException {
    String pngfile = FilenameUtils.getFullPath(ScanCollectionName) + "/" + FilenameUtils.getBaseName(ScanCollectionName) + "_masscaliRT.png";
    XYSeries series = new XYSeries("PSM");
    XYSeriesCollection xySeriesCollection = new XYSeriesCollection();
    LoessInterpolator loessInterpolator = new LoessInterpolator(
            0.75,//bandwidth,
            2//robustnessIters
    );

    for (PSM psm : this.IDsummary.PSMList.values()) {
        float ppm = InstrumentParameter.CalcSignedPPM(psm.ObserPrecursorMass, psm.NeutralPepMass);
        series.add(new XYDataItem(psm.RetentionTime, ppm));
    }
    double x[] = new double[IDsummary.PSMList.size()];
    double y[] = new double[x.length];
    double currentmin = 0f;
    for (int i = 0; i < series.getItemCount(); i++) {
        x[i] = (double) series.getX(i);
        if (x[i] <= currentmin) {
            x[i] = currentmin + 0.0001f;
        }
        currentmin = x[i];
        y[i] = (double) series.getY(i);
    }

    Masscalibrationfunction = loessInterpolator.interpolate(x, y);
    XYSeries smoothline = new XYSeries("Loess Regression");

    double xvalue = series.getMinX();

    while (xvalue < series.getMaxX()) {
        smoothline.add(xvalue, Masscalibrationfunction.value(xvalue));
        xvalue += 0.05d;
    }
    xySeriesCollection.addSeries(smoothline);
    xySeriesCollection.addSeries(series);

    JFreeChart chart = ChartFactory.createScatterPlot("Mass calibration", "RT", "Mass error (ppm)", xySeriesCollection,
            PlotOrientation.VERTICAL, true, true, false);
    XYPlot xyPlot = (XYPlot) chart.getPlot();
    xyPlot.setDomainCrosshairVisible(true);
    xyPlot.setRangeCrosshairVisible(true);

    XYItemRenderer renderer = xyPlot.getRenderer();
    renderer.setSeriesPaint(1, Color.blue);
    renderer.setSeriesPaint(0, Color.BLACK);
    renderer.setSeriesShape(1, new Ellipse2D.Double(0, 0, 3, 3));
    renderer.setSeriesStroke(1, new BasicStroke(1.0f));
    xyPlot.setBackgroundPaint(Color.white);
    ChartUtilities.saveChartAsPNG(new File(pngfile), chart, 1000, 600);
}
 
開發者ID:YcheCourseProject,項目名稱:DIA-Umpire-Maven,代碼行數:52,代碼來源:LCMSPeakMS1.java


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