Any Scala Plotting libraries with 3D plots? - Scientific libraries

For plotting data like curves, the only Scala library that I could find was Breeze which includes 2-dimensional plots. Breeze is is a scientific library somewhat comparable to NumPy and it also includes some limited plotting capability, with little documentation.

To my knowledge Breeze does not include 3-dimensional plots like surfaces, etc., only 2D plots.

Are there any Scala libraries that have 3-dimensional plots? Please let me know.

There are some Java libraries for plotting functions, but I could not successfully call these from Scala. There is a Java library for 3D plots called Jzy3d ( but I could not make it work from Scala. If you know how I can call this Java library from Scala, how to enable it in the sbt build file of my projects, how to import and call it, then I will be very grateful if you let me know.

In any case, I hope that the Scala community will upgrade Breeze to the standards of NumPy and MatPlotLib.

Many thanks!

There is an scala/sbt example for Jzy3d at
Thanks by the way, I should also check out the library.


Thank you for the suggestion, but I have tried that example that you mentioned yesterday, and it failed because for some reason, even after I add the library dependencies in the build.sbt file, certain things are not recognized in the Scala domain.

// For example, although the following package statement is recognized:
package org.jzy3d.demos.surface

// In the import statements below the items like ‘analysis’, ‘chart’, etc that come after org. jzy3d are not //reconized below:
import org.jzy3d.analysis.AbstractAnalysis
import org.jzy3d.analysis.AnalysisLauncher
import org.jzy3d.chart.factories.AWTChartComponentFactory
import org.jzy3d.colors.Color
import org.jzy3d.colors.ColorMapper
import org.jzy3d.colors.colormaps.ColorMapRainbow
import org.jzy3d.maths.Range
import org.jzy3d.plot3d.builder.Builder
import org.jzy3d.plot3d.builder.Mapper
import org.jzy3d.plot3d.builder.concrete.OrthonormalGrid
import org.jzy3d.plot3d.primitives.Shape
import org.jzy3d.plot3d.rendering.canvas.Quality


But if you can make the full example work in your own Scala SBT project, then please let me know how you did it and how exactly you defined the imports and library dependencies. I will appreciate if you try it.

As I mentioned, Breeze is OK for some numerics (although it has less functions than NumPy), it has very limited plotting capability, it only has 2D plots.

On the other hand the PlotLy library does have a Scala interface but in order to enable it you have to register an account with them and put keys in a directory of your computer. They say it has a community edition without payment besides the expensive version, but I do not want my computer to be connected to them via the internet. No strings attached, even though their charts are wonderful
This is their website:

Getting Started Plotly for Scala
Getting Started with Plotly for Scala.


I have an example (but I used mill not sbt since I have switched to that):

This is a hybrid of the example in the tutorials and one on their intro page.


1 Like

Many thanks.

Is it easy to migrate from sbt to Mill in IntelliJ IDEA projects? How about Scala IDE for Eclipse?

Best Regards!!!

Mill has Intellij support built-in and I found migration easy even for fairly large multi-project builds.



1 Like

Apologies for going off-topic but, when you say support built in are you referring to Mill’s command to
generate an IntelliJ project?

There are actually a number of different plotting libraries that integrate with Scala. I put some effort into my own called SwiftVis2, and found quite a few others when looking around to write a paper on the topic. (Something I feel compelled to do as an academic.) I have to admit that I don’t recall seeing significant 3D support, but I wasn’t looking for it either. Other than SwiftVis2, here are the ones that we found.

  • Breeze-viz
  • NSPL
  • scala-chart
  • Bokah
  • Plotly
  • Vegas
  • WISP

The bottom four are aimed primarily at web-based plotting. The top three use Swing to bring up plots on the desktop. Perhaps one of them will have what you are looking for.

1 Like

A while back I was looking for something “ggplot”-like. Just wondering if your “graphical dataflow analysis” is something akin to the language like Vegas.

BTW, just a suggestion - decouple the plotting from any data library (I see you are using Spark). It will
cause issues when updating the Scala version. See

First of all, many thanks for your book!

The SwiftVis2 library seems excellent. I hope that you will find the time to add 3D plotting capability in the future.

As an applied mathematician with limited programming skills, I hope that the Breeze scientific library will be expanded and better maintained in the future, as it is not as broad as NumPy and it also lacks 3D plotting capability.

While many companies are interested in switching to Scala, one missing key capability is the lack of scientific libraries. Especially a powerful and multidimensional language like Scala needs an ecosystem of scientific libraries.

Best Regards!!

Yes, by built in I meant as opposed to needing a plugin.


But is it possible to convert a Mill project back to an SBT project?

Thanks. I would love to be adding more to SwiftVis2, but time has been in short supply. I will definitely consider 3D, but it is hard to do well, especially in regards to how to display axes along with the data in ways that aren’t more confusing than helpful.

I completely agree that Scala needs a good data visualization library. That is exactly why I started writing SwiftVis2. Unfortunately, I just haven’t had any time to take it beyond the opening stages.

It is easy to have both builds, making the file layout compatible with both. I’ll add an SBT build later today to this example.

1 Like

The example for Jzy3d at now has an sbt build too.



1 Like

Many thanks, Siddharta!

I have imported your Scala version of the jzy3d sbt project into the IntelliJ IDEA IDE and it is WORKING PERFECTLY!!!

I am truly grateful. I don’t have a good knowledge of Java but by imitating the documentation of jzy3d it is easy to construct many kinds of plots from Scala. In other words, we now have a very good solution for the lack of Scala 3D libraries.

Again, many thanks for the precious time that you allocated for this example!!!

Best Regards!!!

You are most welcome. It didn’t take long and thanks to your question I now have a 3d plotting library to use myself.



The 3D plotting library jzy3d might be very useful for topology and other areas.

But the Breeze scientific library is a decent Scala alternative to NumPy and SciPy to some extent, especially in their implementation of numerical linear algebra. But very few people are maintaining Breeze, and it is not as complete as NumPy and SciPy.

But on this occasion, let me bring to your attention this website where there is a successful attempt to call Python libraries from Scala. Still passing complicated arguments like matrices between Scala and Python would be difficult.

But unfortunately my attempt to run this Python interface from Scala with my sbt project in Intellij IDE failed. Maybe some library features became obsolete.