File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
src/main/java/org/ruivieira/plotlib Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 4
4
import org .pmw .tinylog .Level ;
5
5
import org .pmw .tinylog .writers .ConsoleWriter ;
6
6
import org .ruivieira .plotlib .plots .Histogram ;
7
+ import org .ruivieira .plotlib .plots .HorizontalLine ;
8
+ import org .ruivieira .plotlib .plots .ScatterPlot ;
7
9
8
10
import java .io .IOException ;
9
11
import java .util .Arrays ;
@@ -18,12 +20,15 @@ public static void main(String[] args) throws IOException {
18
20
.level (Level .DEBUG )
19
21
.activate ();
20
22
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 ];
24
24
25
- figure .add (new Histogram <>(Arrays .asList (x )).setBins (200 ));
25
+ for (int i =0 ; i < 1000 ; i ++) {
26
+ x [i ] = i ;
27
+ }
26
28
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" );
28
33
}
29
34
}
You can’t perform that action at this time.
0 commit comments