# Julia alternatives to Matplotlib?

**URL:** <https://discourse.julialang.org/t/julia-alternatives-to-matplotlib/45445>\
**Category:** New to Julia\
**Tags:** question, package, plotting\
**Created:** [August 24, 2020, 8:35am UTC](https://discourse.julialang.org/t/julia-alternatives-to-matplotlib/45445 "2020-08-24T08:35:34Z")\
**Posts on this page:** 20\
**Page:** 4

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [August 25, 2020, 7:57am UTC](https://discourse.julialang.org/t/julia-alternatives-to-matplotlib/45445/66 "2020-08-25T07:57:43Z")

</div>

> No bro, at least with the default backend (GR) of Plots.jl, there’s no SVG output

That’s not true:

```julia
julia> using Plots

julia> plot(rand(10))

julia> savefig("random_plot.svg")

julia> Plots.backend()
Plots.GRBackend()  

(@v1.5) pkg> st -m Plots GR                                                                                                   
Status `C:\Users\ngudat\.julia\environments\v1.5\Manifest.toml`
  [28b8d3ca] GR v0.51.0 
  [91a5bcdd] Plots v1.6.0

```

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [August 25, 2020, 9:18am UTC](https://discourse.julialang.org/t/julia-alternatives-to-matplotlib/45445/67 "2020-08-25T09:18:20Z")

</div>

> [@mkborregaard](#):
>
> What makes you underline so insistently that Gadfly is 100% but not Makie?

I haven’t said anything about Makie. I just put up Gadfly as a possible alternative that fits the requirement. Feel free to contribute more alternatives…?

---

<div class="post-metadata">

**Author:** ![joa-quim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joa-quim/32/227_2.png) [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Post date:** [August 25, 2020, 9:35am UTC](https://discourse.julialang.org/t/julia-alternatives-to-matplotlib/45445/68 "2020-08-25T09:35:29Z")

</div>

GMT, through [GMT.jl](https://github.com/GenericMappingTools/GMT.jl), lets us virtually configure everything in a plot.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [August 25, 2020, 10:29am UTC](https://discourse.julialang.org/t/julia-alternatives-to-matplotlib/45445/69 "2020-08-25T10:29:55Z")

</div>

GMT certainly looks like a very extensive and powerful library. On the other hand, to me it also looks quite hard to use with a complex net of sub programs. The power to “configure everything” is not what I was talking about, almost every plotting tool has that. You can configure everything in matplotlib as well, but to get to good results you often just have to configure way too many things manually, especially with layouts.

---

<div class="post-metadata">

**Author:** ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)\
**Post date:** [August 25, 2020, 11:34am UTC](https://discourse.julialang.org/t/julia-alternatives-to-matplotlib/45445/70 "2020-08-25T11:34:45Z")

</div>

> [@Tamas\_Papp](#):
>
> In the sense that you can publish papers and/or get a grant on it.

In that case I should be covered. I meant to say that interactivity features are useful also for research.

---

<div class="post-metadata">

**Author:** ![joa-quim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joa-quim/32/227_2.png) [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Post date:** [August 25, 2020, 11:36am UTC](https://discourse.julialang.org/t/julia-alternatives-to-matplotlib/45445/71 "2020-08-25T11:36:51Z")

</div>

[subplot](https://www.generic-mapping-tools.org/GMT.jl/latest/subplot/) is very powerful with lots of nice defaults. What do you find more complicated in it than, Plots.jl, for example? _E.g._ this plots a 2x2 panels

```julia
subplot(grid=(2,2), panels_size=8, region=(0, 100, 0, 80), margins="5p", autolabel=true, col_axes=(bott=true,), row_axes=(left=true,), axes="wstr", name="panels.pdf")
        subplot(:set)
        basemap(region=(0,80,0,50))
        subplot(:set)
        plot([50 40], marker=:circle, mc=:red)
        subplot(:set)
        plot([50 40], marker=:square, mc=:green)
        subplot(:set, panel=(2,2))
        plot([50 40], marker=:star, mc=:blue)
subplot(:show)

```

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [August 25, 2020, 11:39am UTC](https://discourse.julialang.org/t/julia-alternatives-to-matplotlib/45445/72 "2020-08-25T11:39:01Z")

</div>

I really don’t want to get into a comparison of layouting syntax or capabilities here, I was merely motivating why I work on a Julia-based plotting package if there are others out there

---

<div class="post-metadata">

**Author:** ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)\
**Post date:** [August 25, 2020, 11:58am UTC](https://discourse.julialang.org/t/julia-alternatives-to-matplotlib/45445/73 "2020-08-25T11:58:55Z")

</div>

I’ll bite 😃 :

```julia
dat = randn(200, 4) .* [1 2 3 4]
histogram(dat, layout = (2,2), link = :all)

```

![Skærmbillede 2020-08-25 kl. 13.58.15](https://global.discourse-cdn.com/julialang/original/3X/5/b/5bd85f34a3334b7a25ef7d8d807e5aa9e19d60d0.png)

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [August 25, 2020, 12:36pm UTC](https://discourse.julialang.org/t/julia-alternatives-to-matplotlib/45445/74 "2020-08-25T12:36:41Z")

</div>

> [@DNF](#):
>
> In that case I should be covered. I meant to say that interactivity features are useful also for research.

The issue is not that anyone is likely to hold you accountable in academia/research if you work a bit on plotting libraries. That’s how they most of them are actually written.

It’s just that you pay the opportunity cost of using that time for something for which you are actually rewarded, either directly or indirectly. Plotting software _per se_ is financed in very rare cases, eg ggplot2 by RStudio.

---

<div class="post-metadata">

**Author:** ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)\
**Post date:** [August 25, 2020, 1:51pm UTC](https://discourse.julialang.org/t/julia-alternatives-to-matplotlib/45445/75 "2020-08-25T13:51:10Z")

</div>

I’m not disagreeing with that, I was just responding to this particular statement:

> [@anon68507720](#):
>
> the plotting libraries don’t really change research. It’s only how (beautiful or ugly) to show a graphic

---

<div class="post-metadata">

**Author:** ![derekmahar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/derekmahar/32/216439_2.png) [@derekmahar](https://discourse.julialang.org/u/derekmahar)\
**Post date:** [August 25, 2020, 2:07pm UTC](https://discourse.julialang.org/t/julia-alternatives-to-matplotlib/45445/76 "2020-08-25T14:07:42Z")

</div>

I just renamed this topic from “Julia equivalent of Matplotlib?” to “Julia alternatives to Matplotlib?” which I think better expresses what I’m looking for, but invalidates some of the comments.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [August 25, 2020, 2:13pm UTC](https://discourse.julialang.org/t/julia-alternatives-to-matplotlib/45445/78 "2020-08-25T14:13:52Z")

</div>

> [@derekmahar](#):
>
> I just renamed this topic from “Julia equivalent of Matplotlib?” to “Julia alternatives to Matplotlib?” which I think better expresses what I’m looking for, but invalidates some of the comments.

No worries, cache invalidation is a hard problem.

---

<div class="post-metadata">

**Author:** ![tim.holy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tim.holy/32/52_2.png) [@tim.holy](https://discourse.julialang.org/u/tim.holy)\
**Post date:** [August 25, 2020, 2:26pm UTC](https://discourse.julialang.org/t/julia-alternatives-to-matplotlib/45445/79 "2020-08-25T14:26:48Z")

</div>

Not true if you use JuliaInterpreter, which is written in Julia but runs on two turtles and a sloth, neither of which is a programming language.

---

<div class="post-metadata">

**Author:** ![joa-quim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joa-quim/32/227_2.png) [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Post date:** [August 25, 2020, 4:56pm UTC](https://discourse.julialang.org/t/julia-alternatives-to-matplotlib/45445/81 "2020-08-25T16:56:55Z")

</div>

OK, I could have made my example smaller but not a 2-liners 🙂  
… but it can play geo-tic-tac

```julia
subplot(grid="3x3", dims=(panels=(5,),divlines=(1,:dashed)), axes=(axes=:lrbt,), margins=0, savefig="tictactoe.png")
    coast(region=:global, proj=(name=:Ortho, center=(30 ,30)), land=:red, B=:g, panel=(1,1))
    coast(region=:global, proj=(name=:Ortho, center=(120,30)), land=:red, B=:g, panel=(2,2))
    coast(region=:global, proj=(name=:Ortho, center=(210,30)), land=:red, B=:g, panel=(3,3))
subplot(:show)

```

 ![tictactoe](https://global.discourse-cdn.com/julialang/original/3X/f/f/ff4412337ef5db46e0d07706b8a9e4473bfdc9c9.png)

---

<div class="post-metadata">

**Author:** ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)\
**Post date:** [August 25, 2020, 7:17pm UTC](https://discourse.julialang.org/t/julia-alternatives-to-matplotlib/45445/82 "2020-08-25T19:17:31Z")

</div>

well played 🙂

---

<div class="post-metadata">

**Author:** ![kevbonham](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kevbonham/32/216165_2.png) [@kevbonham](https://discourse.julialang.org/u/kevbonham)\
**Post date:** [August 25, 2020, 7:33pm UTC](https://discourse.julialang.org/t/julia-alternatives-to-matplotlib/45445/83 "2020-08-25T19:33:16Z")

</div>

> [@anon68507720](#):
>
> I was talking about the Output in Juno (Atom) or VS Code, the graphics is always displayed as PNG, please learn to read.

I also took your post to be about saving files, so perhaps you were not as clear as you intended. Regardless, even if you were perfectly clear, this kind of antagonism is completely unwarranted.

---

<div class="post-metadata">

**Author:** ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)\
**Post date:** [August 26, 2020, 5:15am UTC](https://discourse.julialang.org/t/julia-alternatives-to-matplotlib/45445/85 "2020-08-26T05:15:29Z")

</div>

> [@anon68507720](#):
>
> But mate, they started to make fun with my post. That is completely unwarranted too.

Where did they make fun of your post? The replies you quoted were perfectly fine and helpful.

By the way, calling people ‘bro’ and ‘mate’ doesn’t come across as friendly.

---

<div class="post-metadata">

**Author:** ![heliosdrm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/heliosdrm/32/3851_2.png) [@heliosdrm](https://discourse.julialang.org/u/heliosdrm)\
**Post date:** [August 26, 2020, 8:38am UTC](https://discourse.julialang.org/t/julia-alternatives-to-matplotlib/45445/86 "2020-08-26T08:38:20Z")

</div>

> [@anon68507720](#):
>
> I was talking about the Output in Juno (Atom) or VS Code, the graphics is always displayed as PNG, there’s no reason to be rude.

I was just negating what I took as a mistake, no rudeness intended. I’m sorry if you felt it like that. That being said, I still think you are wrong. In Atom:

```julia
julia> using GR

julia> inline()
"svg"

```

And when I look at the aspect of the plots in the plot pane, definitely they are like the SVG output, not like PNG, e.g:

```julia
x = randn(1000); y = randn(1000);
plot(x, y, ".")

```

Screenshot of the plot pane (identical to the result of `savefig("scatter.svg")`, although svg images cannot be attached in Discourse):

 ![scattersvg](https://global.discourse-cdn.com/julialang/original/3X/2/c/2c3a6727df00b75c1c7c4a4ff5758a81031fb4f3.png)

Result of `savefig(“scatter.png”) - points are made nearly invisible in the process of rastering:

 ![scatter](https://global.discourse-cdn.com/julialang/original/3X/f/6/f6e1636b27b080b76169ccabdc7ce05b7896ee8f.png)

---

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [August 26, 2020, 2:06pm UTC](https://discourse.julialang.org/t/julia-alternatives-to-matplotlib/45445/88 "2020-08-26T14:06:42Z")

</div>

This post in only about the (im)possibility of Pure Julia plotting, so feel free to ignore. As I said previously it’s not important, as also an impossible goal (also in e.g. Python).

> [@ChrisRackauckas](#):
>
> Makie.jl is a library for handling that, which is pure Julia

None of the its three backends are Julia only, i.e. in the end e.g GLMakie.jl will use GLFW → GLFW\_jll a wrapper for C code.

> [@j\_verzani](#):
>
> For the purist, `Plots` (or `SimplePlots` ) + `UnicodePlots` will likely not require any underlying plotting library.

Here you’re closer (I only see Julia code used), and plotting to the terminal is going to be the only “Pure Julia” in a practical sense (for GUI not possible, unless Julia abstracts over GUI libraries, I believe not done, nor wanted, web GUIs may be an exception), except you rely in Julia itself, and e.g. utf8proc written in C. E.g. utf8proc could conceivably have been written in pure Julia, and maybe even libuv, but at some point you’ll have to do I/O to the screen and it’s just not possible in pure Julia (unless we get “boot2Julia”, running baremetal, no OS, not what you want).

> [@mkborregaard](#):
>
> What makes you underline so insistently that Gadfly is 100% but not Makie?

Gadfly seems to be pure Julia, but it in some sense doesn’t plot to “the screen”, only to a file (or for the example in docs I tried). Yes, this file gets to the screen, as it fires off your web browser (most likely written in C++, in a sense a huge library) displaying the “temporary” file it made (or not? I do not see them going away after closing the web tab, and /tmp may only get cleared on restart, or not).

File I/O is abstracted by Julia, unlike GUI stuff, with the “exception” of display() on that file.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [August 26, 2020, 2:34pm UTC](https://discourse.julialang.org/t/julia-alternatives-to-matplotlib/45445/89 "2020-08-26T14:34:12Z")

</div>

> [@Palli](#):
>
> but it in some sense doesn’t plot to “the screen”, only to a file

This is clearly problematic since the firmware for the HDD/SSD is (probably) not written in Julia either.

[Previous page](https://discourse.julialang.org/t/julia-alternatives-to-matplotlib/45445.md?page=3)

[Next page](https://discourse.julialang.org/t/julia-alternatives-to-matplotlib/45445.md?page=5)
