# An internal Julia plotting package?

**URL:** <https://discourse.julialang.org/t/an-internal-julia-plotting-package/73079>\
**Category:** Internals & Design\
**Tags:** question\
**Created:** [December 14, 2021, 3:12pm UTC](https://discourse.julialang.org/t/an-internal-julia-plotting-package/73079 "2021-12-14T15:12:31Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![gustaphe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustaphe/32/18174_2.png) [@gustaphe](https://discourse.julialang.org/u/gustaphe)\
**Post date:** [December 14, 2021, 8:19pm UTC](https://discourse.julialang.org/t/an-internal-julia-plotting-package/73079/21 "2021-12-14T20:19:35Z")

</div>

I don’t understand how Matlab is your counterexample to this. You _can_ make decent plots in Matlab, but it takes tons of work. By comparison the defaults in Plots.jl are amazing. And the control capabilities are even better.

---

<div class="post-metadata">

**Author:** ![marianoarnaiz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marianoarnaiz/32/19377_2.png) [@marianoarnaiz](https://discourse.julialang.org/u/marianoarnaiz)\
**Post date:** [December 14, 2021, 8:47pm UTC](https://discourse.julialang.org/t/an-internal-julia-plotting-package/73079/22 "2021-12-14T20:47:58Z")

</div>

I kind of understand @leon point.  
I use GMT.jl and Plots.jl. But it is hard, from my point of view, to make fast figures with either. My current workflow is to get some simple figures in Julia and then use GMT or Matlab to make my plots for my publication.

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [December 14, 2021, 9:06pm UTC](https://discourse.julialang.org/t/an-internal-julia-plotting-package/73079/23 "2021-12-14T21:06:13Z")

</div>

What are the features those have that are better? Looking at some examples they do not seem any easier (discounting the fact that one may be fluent with one and not the other).

The idea of building composed plots with different backends is interesting, and a package could do that, maybe Plots itself, as mentioned.

I don’t need (and actually don’t prefer) 3D plots, so there is not much that I miss in Plots+GR. There are small things that I would like to see improved, which are, as far as I can remember now: a) better integration with latex syntax in general, to allow diverse fonts + latex; b) easier layout handling; c) easier fine tuning of positions of annotations, labels, etc.

(b) and (c) get really easy with a GUI, in which one could move the elements on the plot and get the final coordinates. (This is the Origin advantage over all of these)

---

<div class="post-metadata">

**Author:** ![leon](https://avatars.discourse-cdn.com/v4/letter/l/dc4da7/32.png) [@leon](https://discourse.julialang.org/u/leon)\
**Post date:** [December 14, 2021, 9:10pm UTC](https://discourse.julialang.org/t/an-internal-julia-plotting-package/73079/24 "2021-12-14T21:10:32Z")

</div>

I do exactly the same thing!

I would think it is a great thing to design a Julia plotting framework / standard, so that Julia can handle the plot layout, and other plotting packages can fit in with the needed compatibility.

Alternatively, a package called something like PlotLayout.jl should be created to handle that. The issues is that it will be easier to ask the package developers to conform to the standards of Julia, instead of asking them to conform to the standards of another package.

---

<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:** [December 14, 2021, 9:21pm UTC](https://discourse.julialang.org/t/an-internal-julia-plotting-package/73079/25 "2021-12-14T21:21:10Z")

</div>

> [@marianoarnaiz](#):
>
> I use GMT.jl and Plots.jl. But it is hard, from my point of view, to make fast figures with either.

GMT (and GMT.jl) is a **lot** more than just plotting. What is it that you can do easier in Maltlab than in GMT.jl? Honestly, I’m not question your answer, just want to know how things can be improved.

And BTW, though there is not GMT back-end to Plots, many of the plotting options are the same or similar.

Edit: Not counting volume rendering. There Matlab is far superior.

---

<div class="post-metadata">

**Author:** ![marianoarnaiz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marianoarnaiz/32/19377_2.png) [@marianoarnaiz](https://discourse.julialang.org/u/marianoarnaiz)\
**Post date:** [December 14, 2021, 9:49pm UTC](https://discourse.julialang.org/t/an-internal-julia-plotting-package/73079/26 "2021-12-14T21:49:55Z")

</div>

Hi @joa-quim not at all a complaint on the GMT or GMT.jl. We all know GMT is the master for geo-plotting and other types of postscript generation. Maybe it is the old me, but I still rather make my final figures in the standard version of GMT and use GMT.jl for quick figures…

I think the general workflow in Matlab for quick-and-dirty figures, in my opinion, is still the best:  
e.g.

```julia
figure
subplot(2,1,1)
plot(x1,y1,'ok')
hold on
plot(x2,y2,'*r')
subplot(2,1,2)
pcolor(x_matrix,y_matrix,z_matriz)

```

---

<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:** [December 14, 2021, 9:51pm UTC](https://discourse.julialang.org/t/an-internal-julia-plotting-package/73079/27 "2021-12-14T21:51:16Z")

</div>

Yes it would be great if there was one plotting system that can do everything, put that into Julia Base, then everybody can build packages off of that like in Matlab.

The problems:

- build a plotting system first that can do everything (we’re trying in Makie but it’s **hard** , there’s soo much to do)
- convince everyone that this one approach is the best (basically impossible)
- finalize code so that it can be moved into Julia base, therefore no breaking changes are allowed anymore until julia 2.0 (also basically impossible because there’s such a huge surface of functionality, how do you know you’re done)

The path forward is that each plotting package does its best and we see how the user dynamics play out. Users will flock to the most useful, best maintained packages, and we can try to build bridges between the most used packages.

---

<div class="post-metadata">

**Author:** ![marianoarnaiz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marianoarnaiz/32/19377_2.png) [@marianoarnaiz](https://discourse.julialang.org/u/marianoarnaiz)\
**Post date:** [December 14, 2021, 9:58pm UTC](https://discourse.julialang.org/t/an-internal-julia-plotting-package/73079/28 "2021-12-14T21:58:41Z")

</div>

Maybe it is naive of me, but perhaps Julia needs something like BasicPlots.jl. Something that aids during the development of the code.

Not an advance package that can do everything as well and pretty as GMT.jl or Makie.jl. But instead (once again, taking the basic Matlab idea) a package that allow for quick-and-dirty plots. Something simple (with a fast learning curve) that does the very basic 1D and 2D plots (plots, heatmap/pcolor, contours), and maybe some basic 3D (plot3, surface) and some stats plots (histogram, boxplot). Perhaps with a simple layout command (subplot).

The rest can be achieved in the advance plotting package (@joa-quim knows that I will never stop using the GMT 😂).

Just a thought.

---

<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:** [December 14, 2021, 11:21pm UTC](https://discourse.julialang.org/t/an-internal-julia-plotting-package/73079/29 "2021-12-14T23:21:11Z")

</div>

The point, @marianoarnaiz, is that from my perspective your description is exactly what I want to achieve with GMT.jl. For example your `subplot` example is obtainable with something around (sorry, maybe later I can come with a clear working example)

```julia
subplot(grid="2x1")
    plot(x1,y1, marker=:circ, linewidth=0.5)
    plot!(x2,y2, marker=:star, mc=:red)
    pcolor(..., panel=(2,2)) # EXCEPT THAT pcolor is not a GMT.jl module
subplot(:show)

```

But `subplot` is a harder target since there are so many things we may want to do/tune in a subplot figure and at same time make it simple to use. Matlab just choose awful bad defaults that everybody complains about (_e.g._ this ML package called “[Plot it,…but plot it well! (MATLAB)](https://www.mathworks.com/matlabcentral/fileexchange/95368-plot-but-plot-well?s_tid=srchtitle)”)

Anyway have a look at this subplot [toy example](https://discourse.julialang.org/t/julia-alternatives-to-matplotlib/45445/81).

---

<div class="post-metadata">

**Author:** ![anon28281882](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@anon28281882](https://discourse.julialang.org/u/anon28281882)\
**Post date:** [December 14, 2021, 11:44pm UTC](https://discourse.julialang.org/t/an-internal-julia-plotting-package/73079/30 "2021-12-14T23:44:59Z")

</div>

> [@jules](#):
>
> build a plotting system first that can do everything (we’re trying in Makie but it’s **hard** , there’s soo much to do)

It seems that Makie is really the plotting package under the most active development currently. If there is a wish list, I would like to suggest a slightly better support for basic geo plots or if there already is such a support, some additional documentation on this topic.

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [December 14, 2021, 11:53pm UTC](https://discourse.julialang.org/t/an-internal-julia-plotting-package/73079/31 "2021-12-14T23:53:34Z")

</div>

What is the advantage of that relative to:

```julia
julia> using Plots

julia> plot(layout=(1,2))

julia> plot!(rand(10),subplot=1)

julia> heatmap!(rand(10,10),subplot=2)

```

? (serious question - meaning, what does that matlab workflow do that is so interesting? From the examples and code snippets I don’t get it)

---

<div class="post-metadata">

**Author:** ![leon](https://avatars.discourse-cdn.com/v4/letter/l/dc4da7/32.png) [@leon](https://discourse.julialang.org/u/leon)\
**Post date:** [December 14, 2021, 11:57pm UTC](https://discourse.julialang.org/t/an-internal-julia-plotting-package/73079/32 "2021-12-14T23:57:56Z")

</div>

The point is that Matlab handles layout from within, thus allowing subplots to be made from any external packages.

In your example, imagine you want to make subplot 1 using GMT.jl and subplot 2 using Makie.jl, and so on.

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [December 15, 2021, 12:02am UTC](https://discourse.julialang.org/t/an-internal-julia-plotting-package/73079/33 "2021-12-15T00:02:17Z")

</div>

> [@leon](#):
>
> In your example, imagine you want to make subplot 1 using GMT.jl and subplot 2 using Makie.jl, and so on.

Nice. That is something interesting, yes, and clearly could be an interesting development route for future `Plots.jl`.

---

<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:** [December 15, 2021, 12:06am UTC](https://discourse.julialang.org/t/an-internal-julia-plotting-package/73079/34 "2021-12-15T00:06:15Z")

</div>

> [@leon](#):
>
> made from any external packages.

Ok, you keep reasoning on the illusion that Matlab accepts more than one packages.

… but maybe you are thinking in [GMTMEX](https://github.com/GenericMappingTools/gmtmex), the GMT.jl ancestor but again, have no illusion, there is no other plotting package in Matlab than the one provided by TMW (which changed dramatically arround Matlab2015)

---

<div class="post-metadata">

**Author:** ![leon](https://avatars.discourse-cdn.com/v4/letter/l/dc4da7/32.png) [@leon](https://discourse.julialang.org/u/leon)\
**Post date:** [December 15, 2021, 1:08am UTC](https://discourse.julialang.org/t/an-internal-julia-plotting-package/73079/35 "2021-12-15T01:08:55Z")

</div>

Thanks for the comments , Joa-quim!

No, I’m not thinking of GMTMEX.

One thing I want to make clear is that this discussion is about how we, as a group, could make Julia better. The use of Matlab as an example is just a coincidence. I have no interests of creating any illusion on a programming language that I’m trying to stay away from 🙂

---

<div class="post-metadata">

**Author:** ![gustaphe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustaphe/32/18174_2.png) [@gustaphe](https://discourse.julialang.org/u/gustaphe)\
**Post date:** [December 15, 2021, 6:09am UTC](https://discourse.julialang.org/t/an-internal-julia-plotting-package/73079/36 "2021-12-15T06:09:05Z")

</div>

A single figure with subplots generated by different plotting backends sounds like it would be nothing but ugly and confusing. Why is that something you need?

---

<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:** [December 15, 2021, 7:25am UTC](https://discourse.julialang.org/t/an-internal-julia-plotting-package/73079/37 "2021-12-15T07:25:33Z")

</div>

This is not about layouts at all, you’re mixing frontend and backend. Matlab has one backend and lots of frontend packages, which are of course combinable because they all use the same backend. In your comparison to the Julia ecosystem, you list a bunch of backend packages, where it’s not easy at all to make the parts work together because they are entirely different things. The simplest thing about it would be layouting, all the other backend stuff is the problem, which matlab just doesn’t have because there’s only one backend. So it confuses me a little that this thread keeps going on about layouts when that’s not the point. What you want is one unified backend, and that’s not going to happen (soon).

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [December 15, 2021, 7:58am UTC](https://discourse.julialang.org/t/an-internal-julia-plotting-package/73079/38 "2021-12-15T07:58:12Z")

</div>

> [@jules](#):
>
> What you want is one unified backend, and that’s not going to happen (soon).

@jules, how the lack of a unified backend prevents the use of the same plotting language and shortcuts (at least, as much as possible)?

For example, what obstacles do the different backends pose to allowing a common syntax such as: `plot(sin, lc=:red, lw=2)` (shortcuts for `line_color` and `line_width`) ?

The most annoying thing is to have to learn several “plotting languages” on the same julia platform, to achieve exactly the same thing.

Thanks for your expert advice.

---

<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:** [December 15, 2021, 8:29am UTC](https://discourse.julialang.org/t/an-internal-julia-plotting-package/73079/39 "2021-12-15T08:29:55Z")

</div>

Well you see exactly that playing out in Plots.jl, it tries to unify backends (matplotlib, GR, plotly.js, etc.) but that only goes so far. At some point, backends are just different and to be flexible one needs to descend down to the backend syntax, at which point the gains from Plots.jl are not so big anymore. So yeah I’m not a big believer in “unified syntax”, I’d rather learn one backend that is powerful really well than have one abstraction for five backends that is imperfect for each of them. Many people seem to prefer the second one though, which is fine, that’s why Plots.jl exists.

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [December 15, 2021, 9:01am UTC](https://discourse.julialang.org/t/an-internal-julia-plotting-package/73079/40 "2021-12-15T09:01:24Z")

</div>

@jules, is it possible to allow both? That is, a shorter subset of the common syntax (with limited functionality) and the full-fledged “backend-specific” syntax?

[Previous page](https://discourse.julialang.org/t/an-internal-julia-plotting-package/73079.md?page=1)

[Next page](https://discourse.julialang.org/t/an-internal-julia-plotting-package/73079.md?page=3)
