(Plot currentPlot)
| 2801 | } |
| 2802 | |
| 2803 | double addToPlot(Plot currentPlot) { |
| 2804 | String shape = getFirstString(); |
| 2805 | int what = Plot.toShape(shape); |
| 2806 | double[] x = getNextArray(); |
| 2807 | double[] y; |
| 2808 | double[] errorBars = null; |
| 2809 | String label = null; |
| 2810 | if (interp.nextToken()==')') { |
| 2811 | y = x; |
| 2812 | x = new double[y.length]; |
| 2813 | for (int i=0; i<y.length; i++) |
| 2814 | x[i] = i; |
| 2815 | } else { |
| 2816 | interp.getComma(); |
| 2817 | y = getNumericArray(); |
| 2818 | if (interp.nextToken()!=')') { |
| 2819 | interp.getComma(); |
| 2820 | if (isArrayArg()) //can error bars (array) or label |
| 2821 | errorBars = getNumericArray(); |
| 2822 | else |
| 2823 | label = getString(); |
| 2824 | } |
| 2825 | } |
| 2826 | interp.getRightParen(); |
| 2827 | if (what==-1) |
| 2828 | currentPlot.addErrorBars(y); |
| 2829 | else if (what==-2) |
| 2830 | currentPlot.addHorizontalErrorBars(y); |
| 2831 | else if (errorBars != null) |
| 2832 | currentPlot.addPoints(x, y, errorBars, what); |
| 2833 | else |
| 2834 | currentPlot.add(shape, x, y); |
| 2835 | if (label != null) |
| 2836 | currentPlot.setLabel(-1, label); |
| 2837 | return Double.NaN; |
| 2838 | } |
| 2839 | |
| 2840 | double replacePlot(Plot plot) { |
| 2841 | int index = (int)getFirstArg(); |
no test coverage detected