Skip to content

Instantly share code, notes, and snippets.

@dacr
Last active May 8, 2023 20:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dacr/56cb6df878fc1ebc00968b9bcd0b1c3e to your computer and use it in GitHub Desktop.
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/945381f5a0ed066075295b0b93ac8521c59316e
// 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.2.2"
//> using dep "com.github.haifengl:smile-scala_2.13:3.0.1"
// ---------------------
import smile.stat.distribution.*
import smile.plot.swing.*
import smile.plot.show
import smile.plot.Render.*
// 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