Last active
September 1, 2024 10:15
-
-
Save dacr/56cb6df878fc1ebc00968b9bcd0b1c3e to your computer and use it in GitHub Desktop.
smile visualization qqplot / published by https://github.com/dacr/code-examples-manager #5a091c44-98fa-4462-a743-fc1bf51c4245/7a1e57282bdc066ea9a5c3c6c859a42bab7e62ba
This file contains hidden or 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
// summary : smile visualization qqplot | |
// keywords : smile, chart, visualization | |
// publish : gist | |
// authors : David Crosson | |
// license : Apache NON-AI License Version 2.0 (https://raw.githubusercontent.com/non-ai-licenses/non-ai-licenses/main/NON-AI-APACHE2) | |
// id : 5a091c44-98fa-4462-a743-fc1bf51c4245 | |
// created-on : 2021-03-05T09:23:01Z | |
// managed-by : https://github.com/dacr/code-examples-manager | |
// run-with : scala-cli $file | |
// --------------------- | |
//> using scala "3.4.2" | |
//> using dep "com.github.haifengl::smile-scala:3.1.1" | |
// --------------------- | |
import smile.stat.distribution.* | |
import smile.plot.swing.* | |
import smile.plot.show | |
// examples coming from http://haifengl.github.io/visualization.html | |
implicit val renderer:Canvas=>Unit = JWindow.apply | |
// -------------------------------------------------------------------- | |
{ | |
val gauss = new GaussianDistribution(0.0, 1.0) | |
val data = (0 until 1000) map { (i: Int) => gauss.rand } | |
show(qqplot(data.toArray)) | |
} | |
// -------------------------------------------------------------------- | |
println("enter to exit"); scala.io.StdIn.readLine() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment