Created
September 19, 2018 12:08
-
-
Save csokol/ace67552a79645ba6002523c3c11fd17 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.FileNotFoundException; | |
import java.io.PrintWriter; | |
import java.util.Random; | |
import java.util.stream.IntStream; | |
public class Foo { | |
public static void main(String[] args) throws FileNotFoundException { | |
IntStream range = IntStream.range(1, 100_000); | |
PrintWriter datafile = new PrintWriter("datafile"); | |
range.map(i -> new Random(i).nextInt(100)) | |
.forEach(datafile::println); | |
datafile.close(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set term png | |
set output "hist.png" | |
binwidth=1 | |
bin(x,width)=width*floor(x/width) | |
plot 'datafile' using (bin($1,binwidth)):(1.0) smooth freq with boxes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment