An internal Julia plotting package?

My understanding is that right now there are many Julia plotting packages but none of them is quite capable of producing high quality publication ready plots yet, is that right? I wonder if Julia could consider implementing internal Julia plotting capabilities by leveraging the pros of existing plotting packages and filling any gaps?

For example, right now, I can’t even create a figure with multiple subplots, e.g., one of them from the Plots.jl, one of them from the GMT.jl and one of them from Mackie.jl.

I think the lack of strong plotting capabilities is one of the main reasons I can’t quite ditch Matlab yet.

Thanks for your consideration.

1 Like

what do you mean by internal?

1 Like

Functions that can be called without installing an external Pkg.

You mean a plotting standard library? That seems exceedingly unlikely, given the trend in Julia is to move things out of, rather than into, standard libraries for various reasons (you can search around this forum to find many discussions).

I also don’t think that no plotting package is capable of producing high quality publication ready plots yet, but that might depend on your definition of a high quality publication ready plot. There are certainly many published papers with Julia plots in them, so I presume that the authors of those papers considered the plots publication ready.

18 Likes

Many thanks for the comments!

Do you know which plotting package is the best to learn?

Learn makie if you are doing geo-spatial stuff. That way you can have sub-plots from geo-spatial and vanilla plots in the same figure.

2 Likes

I have been using Plots with GR in my work, and I am mostly satisfied with it. Here are some tips I have written some time ago:

Here is one recent figure which I think is quite “publication ready”, in the sense that is very consistent in terms of fonts, etc:

The script to building it is:

18 Likes

Wonderful. Many thanks for sharing.

2 Likes

Thanks for the recommendation.

That’s one of the cons of the Julia setup I would think. In Matlab, you can use whatever package to plot a subplot, but it is Matlab who handles the layout of the overall figure. I really think Julia should do the same thing. It unleashes so much more flexibilities.

For example, I want to plot my geo-spatial maps using GMT.jl, does that mean I would have to make my x-y subplots using GMT.jl in the same figure? No, I should be able to make my subplot 1 using Plots.jl, my subplot 2 using GMT.jl, my subplot 3 using Makie.jl, and so on.

I don’t see any fundamental limitations preventing Plots.jl from supporting arbitrary renders (e.g. Makie plots) as subplots.

1 Like

Well, the good news is that Julia is open-source. So you could be the person to implement this! :wink:

4 Likes

This need not be in the stdlib though. If there were a common library for this that all the plotting libraries could interop with, you could get the same result.

Speaking more broadly, it’s worth noting that the Julia community is pretty diverse and has an equally diverse set of use cases. For each request asking to bundle more functionality with the base language, there is one asking to slim down the sysimage/compilation size for better deployment. For each request to add some subsystem (e.g plotting) to the stdlib, there is another one asking to remove one for the sake of easier maintenance/latency/etc. Matlab gets around this by only catering to the first group, but I think most here would agree that Julia’s niche should be much larger than Matlab’s!

7 Likes

Check out VegaLite.jl, we’ve been using it on a current project to produce all of our figures and so far it has proven more than capable to accommodate a lot of very detailed twists and tweaks, certainly publication quality level. The core trick is to start with the VegaLite.jl docs, but then quickly move onto the original vega-lite docs which are very comprehensive. Plus, if VegaLite.jl is not flexible enough, one can always transition to Vega.jl, which has even more degrees of freedom (but is also more verbose).

6 Likes

In Matlab there is ONLY one plotting system so your example

I should be able to make my subplot 1 using Plots.jl, my subplot 2 using GMT.jl, my subplot 3 using Makie.jl, and so on.

would NOT be possible in Matlab. … but in Julia, yes. Just produce the individual figures in a raster format and make a mosaic of the subplots out of them. GMT.jl can do it and I’m (almost) sure the others as well.

3 Likes

In Matlab, I can make subplots using any external Matlab plotting toolboxes. Below is how I normally plot figures in Matlab:

handle = figure(1)
han01 = subplot(2,2,1)
   plot using whatever package
hand02 = subplot(2,2,2)
   plot using whatever package
han03 = subplot(2,2,3)
   plot using whatever package
hand04 = subplot(2,2,4)
   plot using whatever package.

For example, my geo-spatial subplots in Matlab are usually plotted using M_maps, which is an external mapping toolbox created by someone outside Mathworks.

Have a look at the M_maps source code. Is calls the Matlab (Java) functions to do the plotting. There is absolutely no way out of this (well, excluding some adventures in calling OpenGL directly). Believe me, I have deep experience with the Matlab plotting system and Mirone is a tool that I dreamed to port to Julia but nothing convenient for that has appeared yet.

4 Likes

That will be down to preference and use cases. But check this out Beautiful Makie Gallery

4 Likes

This related thread suggests that the claim is largely false.

1 Like

Edit:
It seems that @carstenbauer is in a good mood today :-).

Edit:
I just spotted my previous post was hidden by community flags. Just wanted to add that there was nothing personal nor there were any inappropriate intentions. I see the reason raised was “Your post was flagged as off-topic: the community feels it is not a good fit for the topic, as currently defined by the title and the first post.” I guess that’s possibly the same level of conversation as my interlocutor’s. Anyway, I was in a good mood and decided to express it publicly. Nothing else! :slight_smile:

Hi,

I think the best way to see it, is that matlab has a single plotting system.
All other packages, perform their plotting using that single system.

As was pointed out, in julia there is not one single plotting system, but many such as Plots.jl, Makie.jl, Gadfly.jl, Gaston.jl and many more.

The reason there is no single officially endorsed plotting system, was explained
by other people here in the thread.

In spite of this, some of those plottings systems offer ways to develop extensions for other packages.
Most notable example is Plots.jl which has a recipe system which allows third party packages to integrate their plotting with the Plots.jl system. This recipe system allows you to create combined figures using different packages and you should be able to make something like

han01 = subplot(2,2,1)
   plot using whatever package
hand02 = subplot(2,2,2)
   plot using whatever package
han03 = subplot(2,2,3)
   plot using whatever package
hand04 = subplot(2,2,4)
   plot using whatever package.

work within the Plots.jl recipe system as long as every “whatever package” complies with the recipe interface. You can have a look at this here.

I’m not sure but I think Makie.jl has similar recipe infrastructure. Unfortunately, these recipe systems are not necessarily compatible between each other.

I think people are working or will work in the future on making Make.jl recipes compatible with Plots.jl recipes.

I hope this helps
Olivier

1 Like