Commit b048b78f authored by Rui Vieira's avatar Rui Vieira

Add monotonic cubic spline interpolation

parent 38297bf1
......@@ -4,6 +4,8 @@ import org.pmw.tinylog.Configurator;
import org.pmw.tinylog.Level;
import org.pmw.tinylog.writers.ConsoleWriter;
import org.ruivieira.plotlib.plots.Histogram;
import org.ruivieira.plotlib.plots.HorizontalLine;
import org.ruivieira.plotlib.plots.ScatterPlot;
import java.io.IOException;
import java.util.Arrays;
......@@ -18,12 +20,15 @@ public class Test {
.level(Level.DEBUG)
.activate();
Figure figure = new Figure();
Double[] x = new Double[]{1.0, 2.0, 3.0, 4.0};
Integer[] x = new Integer[1000];
figure.add(new Histogram<>(Arrays.asList(x)).setBins(200));
for (int i=0 ; i < 1000 ; i++) {
x[i] = i;
}
System.out.println(figure.getBufferedImage());
Figure figure = new Figure();
figure.add(new ScatterPlot<>(Arrays.asList(x), Arrays.asList(x)));
figure.add(new HorizontalLine<>(10.0).setColour("black").setLineStyle("--"));
figure.save("/tmp/did.png");
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment