01 /*
02 * $Id: MultiPlot2.java,v 1.7 2008/02/02 03:06:29 koga Exp $
03 *
04 * Copyright (C) 2004 Koga Laboratory. All rights reserved.
05 *
06 */
07 package matxbook.chap12old;
08
09 import org.mklab.nfc.matrix.DoubleMatrix;
10 import org.mklab.tool.graph.mgplot.Mgplot;
11
12
13 /**
14 * @author koga
15 * @version $Revision: 1.7 $, 2004/05/01
16 */
17 public class MultiPlot2 {
18
19 /**
20 * メインメソッド
21 *
22 * @param args コマンドライン引数
23 * @throws InterruptedException 強制終了された場合
24 */
25 public static void main(String[] args) throws InterruptedException {
26 DoubleMatrix t1 = DoubleMatrix.series(0, 4 * Math.PI, 0.05);
27 DoubleMatrix t2 = DoubleMatrix.series(0, 4 * Math.PI, 1.0);
28 DoubleMatrix s1 = t1.sinElementWise();
29 DoubleMatrix c1 = t1.cosElementWise();
30 DoubleMatrix c2 = t2.cosElementWise();
31 Mgplot.plot(1, t1, s1, new String[] {"sin(t)"}); //$NON-NLS-1$
32 Mgplot.replot(1, t1, c1, new String[] {"cos(t) (fine)"}); //$NON-NLS-1$
33 Mgplot.replot(1, t2, c2, new String[] {"cos(t) (gross)"}); //$NON-NLS-1$
34 Thread.sleep(10000);
35 Mgplot.quit();
36 }
37 }
|