Plotting with scala-chart

scala-chart is a wrapper for JFreeChart that provides a more convenient interface for working with JFreeChart than using the Java library directly. It allows you to accomplish everything that JFreeChart does with fewer lines of code and at the same time using idiomatic Scala, a definite feel-good factor. In this section, we will see how to replicate the plots from the previous section using this library. The website for scala-chart is given here:

https://github.com/wookietreiber/scala-chart

Installing scala-chart

Create a build.sbt file in your project directory like we have done through most of this book. Then, add the following lines to it to pull-in the required dependencies:

libraryDependencies += "com.github.wookietreiber" ...

Get Scientific Computing with Scala now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.