このコードを使用して、散布図を描くことができます。
import javax.swing.*;
import org.math.plot.*;
public class ScatterPlotExample {
public static void main(String[] args) {
double[] x = new double[] { 60 };
double[] y = new double[] { 50 };
// create your PlotPanel (you can use it as a JPanel)
Plot2DPanel plot = new Plot2DPanel();
// add a line plot to the PlotPanel
plot.addScatterPlot("teeeeest", x, y);
// put the PlotPanel in a JFrame, as a JPanel
JFrame frame = new JFrame("a plot panel");
frame.setSize(600, 600);
frame.setContentPane(plot);
frame.setVisible(true);
}
}
2つの質問:
軸の範囲を1から100にするにはどうすればよいですか?
その散布図に、x=0.4およびy=0.7での水平線と垂直線をどのように描画できますか?
ありがとうございました!