Skip to content

Commit b048b78

Browse files
committed
Add monotonic cubic spline interpolation
1 parent 38297bf commit b048b78

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/main/java/org/ruivieira/plotlib/Test.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import org.pmw.tinylog.Level;
55
import org.pmw.tinylog.writers.ConsoleWriter;
66
import org.ruivieira.plotlib.plots.Histogram;
7+
import org.ruivieira.plotlib.plots.HorizontalLine;
8+
import org.ruivieira.plotlib.plots.ScatterPlot;
79

810
import java.io.IOException;
911
import java.util.Arrays;
@@ -18,12 +20,15 @@ public static void main(String[] args) throws IOException {
1820
.level(Level.DEBUG)
1921
.activate();
2022

21-
Figure figure = new Figure();
22-
23-
Double[] x = new Double[]{1.0, 2.0, 3.0, 4.0};
23+
Integer[] x = new Integer[1000];
2424

25-
figure.add(new Histogram<>(Arrays.asList(x)).setBins(200));
25+
for (int i=0 ; i < 1000 ; i++) {
26+
x[i] = i;
27+
}
2628

27-
System.out.println(figure.getBufferedImage());
29+
Figure figure = new Figure();
30+
figure.add(new ScatterPlot<>(Arrays.asList(x), Arrays.asList(x)));
31+
figure.add(new HorizontalLine<>(10.0).setColour("black").setLineStyle("--"));
32+
figure.save("/tmp/did.png");
2833
}
2934
}

0 commit comments

Comments
 (0)