Julia alternatives to Matplotlib?

What are some alternatives to Python library Matplotlib but implemented in Julia?

1 Like

Again (like for symbolic math) ā€œequivalenceā€ is quite restricting the possible answers:
https://github.com/JuliaPy/PyPlot.jl

1 Like

Yes, I am interested in pure native Julia implementations.

Makie.jl might be the one you are looking for GitHub - JuliaPlots/Makie.jl: High level plotting on the GPU.. Disclaimer I have never used it myself.

What do you mean by ā€œequivalentā€? Just in the sense of being a plotting library or in the sense of having the same syntax or specific features? And what do you consider ā€œpure native Juliaā€? I donā€™t think there are any Julia plotting packages that implement a full plotting backend to render and display plots, except for maybe UnicodePlots.jl

3 Likes

GitHub - GiovineItalia/Gadfly.jl: Crafty statistical graphics for Julia. is a pretty popular

GitHub - GiovineItalia/Gadfly.jl: Crafty statistical graphics for Julia. is pretty much that.

3 Likes

By ā€œequivalentā€, I mean same purpose and similar features. By ā€œpure native Juliaā€, I mean implemented entirely in Julia.

1 Like

How much is ā€˜entirelyā€™? Matplotlib is 89% Python, 8% C++, and then a smattering of other languages. Is that enough to be entirely Python?

Itā€™s a bit hard to answer, anyway, it seems. If you go to https://github.com/JuliaPy/PyPlot.jl, it says that pyplot is 100% Julia, but of course, itā€™s an interface to the python code.

Gadfly.jl and Makie.jl are 100% Julia according to github, but not sure exactly what that means, except that the code in the repository is just Julia. They might call out to other libraries for various things.

3 Likes

Entirely => 100%

So not equivalent to Matplotlib then?

Anyway, http://gadflyjl.org is probably the one that does the most composing from within Julia code.

4 Likes

Interestingly, Gadfly appears to be able to create an SVG in pure Julia by relying on Compose as a backend: Backends Ā· Gadfly.jl

So maybe this could be considered pure Julia as long as one doesnā€™t save a pngā€¦

Itā€™s maybe a little unproductive though to muse about what is or isnā€™t ā€œpureā€, instead it would probably be more helpful to clarify where the need for ā€œpurityā€ stems from to understand what bits of the plotting library need to be written in Julia to meet the OPā€™s needs.

7 Likes

Yes, equivalent in purpose and function, but not in programming language composition. In that respect, Iā€™d prefer a 100% (or closest to 100%) Julia implementation.

I want to solve the problems in the book Doing Math with Python in Julia instead of Python and would prefer to use a plotting library written entirely (or closest to entirely) in Julia.

1 Like

This is understood, but we still donā€™t know why this is so important to you.

With all other things being equal, of course a native implementation is preferable. But plotting is one of those applications that is full of finicky corner cases and quirks, so pooling resources among various languages actually makes sense.

If you just want to make some 2D plots of math functions, pretty much any reasonably maintained Julia plotting package would do. With the introduction of artifacts, even those that call out to non-native libraries are pretty robust.

7 Likes

Itā€™s not absolutely essential, only a strong preference, though probably not even the best choice given my purpose. It would also satisfy my curiosity of whether there exists such a pure Julia plotting library.

Use Gadfly then.

2 Likes

This would disqualify them as pure Julia, but qualify them if there were no other options. The most straightforward choice would be to just use Python and Matplotlib, but Iā€™m trying to avoid Python. Iā€™m discovering that this is still a challenging goal in math and science.

Not really: if you just donā€™t want to code in Python, you donā€™t have to write a single line of it.

What the backend actually uses should be irrelevant per se, as it is not exposed for most packages.

2 Likes

Good point. I should have written, ā€œtrying to avoid Python code and Python libraries,ā€ even if those libraries are hidden behind (or underneath) a Julia wrapper.

The Julia compiler isnā€™t written in Julia. Does that disqualify the language itself?

Not a rhetorical question, I just want to nail down what level of purity weā€™re talking about.

1 Like