Plot2DPanel plot = new Plot2DPanel();
Plot2DPanel plot1 = new Plot2DPanel();
plot.addScatterPlot("Error plot", Color.yellow, data1);
plot1.addScatterPlot("Error plot", Color.GREEN, data2);
// put the PlotPanel in a JFrame, as a JPanel
JFrame frame = new JFrame("a plot panel");
frame.setSize(600, 600);
frame.setContentPane(plot);
frame.setContentPane(plot1);
frame.setVisible(true);
我想在同一张图上绘制 2 个散点图。我试图通过上面的代码来做到这一点,但它不起作用。在输出中,我只得到 data2 的散点图。我该怎么做?