本文整理汇总了Java中de.erichseifert.gral.plots.lines.SmoothLineRenderer2D类的典型用法代码示例。如果您正苦于以下问题:Java SmoothLineRenderer2D类的具体用法?Java SmoothLineRenderer2D怎么用?Java SmoothLineRenderer2D使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SmoothLineRenderer2D类属于de.erichseifert.gral.plots.lines包,在下文中一共展示了SmoothLineRenderer2D类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createSpecificPlot
import de.erichseifert.gral.plots.lines.SmoothLineRenderer2D; //导入依赖的package包/类
private JPanel createSpecificPlot() {
GridResult grid = results.get(selectedIndex);
for (int i = 0; i < grid.test.size(); i++) {
dataSpecific.add((double)i, grid.test.get(i), grid.train.get(i) );
}
DataSeries seriesTest = new DataSeries("Test",dataSpecific, 0, 1);
DataSeries seriesTrain = new DataSeries("Training",dataSpecific, 0, 2);
// Create a new xy-plot
final XYPlot plot = new XYPlot(seriesTest,seriesTrain);
// Format plot
plot.setInsets(new Insets2D.Double(60, 60, 60, 20));
plot.getTitle().setText(grid.name);
plot.setLegendVisible(true);
plot.setLegendLocation(Location.NORTH);
specificPlot = plot;
SmoothLineRenderer2D renderTest = new SmoothLineRenderer2D();
renderTest.setColor(deriveDarker(Color.RED));
PointRenderer renderTestPoint = new DefaultPointRenderer2D();
renderTestPoint.setColor(renderTest.getColor());
plot.setLineRenderers(seriesTest, renderTest);
plot.setPointRenderers(seriesTest, renderTestPoint);
SmoothLineRenderer2D renderTrain = new SmoothLineRenderer2D();
renderTrain.setColor(deriveDarker(Color.BLUE));
PointRenderer renderTrainPoint = new DefaultPointRenderer2D();
renderTrainPoint.setColor(renderTrain.getColor());
plot.setLineRenderers(seriesTrain, renderTrain);
plot.setPointRenderers(seriesTrain, renderTrainPoint);
plot.getAxisRenderer(XYPlot.AXIS_X).getLabel().setText("Epoc");
plot.getAxisRenderer(XYPlot.AXIS_Y).getLabel().setText("Score");
plot.getAxis(XYPlot.AXIS_Y).setAutoscaled(false);
plot.getAxis(XYPlot.AXIS_Y).setRange(0,101);
specificPlotPanel = new InteractivePanel(plot);
JPanel wrapper = new JPanel();
wrapper.setLayout(new BorderLayout());
wrapper.add(specificPlotPanel,BorderLayout.CENTER);
wrapper.setBackground(Color.WHITE);
return wrapper;
}