Tips to create beautiful, publication-quality plots

You are right, my sincere apologies for sounding impolite, I have not meant to show any disrespect. Again, I love Julia for what it is, I use it daily for most of my tasks. I’m by no means proficient enough to contribute to enormous packages like Plots. I’m just a frustrated end user of plotting packages in Julia.
I am being too demanding, sorry for being rude.

1 Like

What I meant to say is that both Plots.jl and Makie.jl implement complex 3d plots, animations, layouts. It looks good, it works, but simpler things like scientific notation, axes offsets, colorblind friendly default colorschemes need work too. I personally feel that the focus is on more complex stuff, which 99% of users do not really require. By showcase I mean, there are tons of complicated examples, but trivial things like I have shown here are just overlooked.

Regarding PGFPlotsX, you are right, I take it back. However, there are around a dozen of plotting packages that are not excellent.

Thank your reply. Apologies, if you are offended by my remarks. I’m by no means a package developer, I do not know what it takes to make everything work.

4 Likes

What works really well for me to produce nice, publication ready scientific plots is to use PGFPlotsX (or the pgfplotsx backend in Plots or StatsPlots) and save a preliminary version of the plot as a tex file. The fine-tuning I do directly in latex.

4 Likes

Perhaps you know this, but most PGFPlotsX constructs allow passing LaTeX code directly, so you can tweak “in Julia”. In case you find that this does not work in some context, please open an issue.

1 Like

Those two packages are very different.

Plots.jl is a unified interface to various plotting backends. I don’t think anything ended up in it without users requiring it. On the contrary: there are still many outstanding feature requests, which its relentlessly dedicated maintainers are working on implementing.

Makie.jl is a GPU-based plotting package, and while it can be used for generic plots, its comparative advantage is complex, interactive 3D plots. Most mature languages have similar libraries, because they serve a very important purpose in some fields.

Julia users now have a lot of plotting choices. For publication quality plots, my first choice is PGFPlotsX, and GR is nice for fast plotting, either directly or via Plots.jl. Users familiar with some plotting libraries from other languages find various Plots.jl backends comfortable.

Of course all plotting libraries require some investment for complex plots, and occasionally you have to be prepared to get your hands dirty and make a PR, or at least isolate an issue with an example. Julia is not unique in this respect: there are whole books about plotting libraries in other languages.

The major outstanding issue is “time to first plot”, and it is in the process of being addressed.

9 Likes

I don’t think Gnuplot can simplify the tics by factoring out 1e-11+1e1 like PyPlot does. That’s pretty clever, even if it might confuse unattentive readers. However, you can at least see the tics correctly by specifying the tics format:

plot(x,y,gpcom="set format y '%.13f'")

produces:

Keep in mind that Gaston’s purpose is to produce quick plots for exploring results on screen/jupyter/juno, not produce publication-quality plots. To me, publication is the realm of Latex and pgfplots.

Having said that, I want Gaston to be useful. I welcome feedback and pull requests at Issues · mbaz/Gaston.jl · GitHub

6 Likes

I both agree with you and at the same time agree with others who feel these kinds of posts are either not very useful or can come across as demanding / rude. I am for example working on MakieLayout.jl because like you I saw that plotting packages were lacking, for me it’s very important that even a fast GPU-powered library like Makie can produce plots that look good and for that I need nicely aligned axes with neat axis labels (that have consistent sizes and looks) and widgets.

The thing is, I’m just one person, and Simon who works on the base Makie package is also just one person (there are others who help but he’s doing almost everything by himself). So there is always, with every little feature, the question of priorities. Log-scales are more complicated than you would think in a GPU powered package because they have to be implemented at shader level and break a lot of camera logic, so it’s not that we don’t think they’re important, they are just constantly being trumped by other aspects that are more important (to us). Images and 3D surfaces for example don’t really need them, and that’s something where Makie already excels compared to matplotlib (especially with interaction added).

Your case of the exponent offset is also “relatively rare” even though it’s annoying if it doesn’t work, I agree. Yes, PyPlot offers this functionality but these guys had thousands of hours more than us to polish these small things after the big problems were solved. I’m sometimes astonished what little things have been implemented that you only find after a deep dive into documentation. Most people will never even find out about a lot of the available functionality, while at other times you’ll be so glad that someone once spent the time to debug those lesser known functions so you have a nice experience now.

So if such a functionality is missing in Makie or MakieLayout, e.g., the most productive thing you can do is not complain that we are focusing on the wrong things and “showcasing our products” (even though I know it’s not true it can still be hurtful to read), but write an encouragingly worded issue on Github about it, in the best case showing that you yourself were willing to spend some time on the problem (because you understand our time is valuable as well) and hit a wall, not just “I need this so I want you to make this”. I know that it’s daunting sometimes with the size of these code bases to contribute code yourself, but if you’re nice to the developers they will mostly be very motivated to help, because they spent so much time on their projects already and would love to see them being useful to others.

Regarding fonts that are different for latex expressions, numbers, or normal words, misaligned dashes, etc. Before you open an issue on stuff like this, know that the package authors are mostly already aware of these more “obvious” problems, and that they’re probably quite tricky to fix. Everything with text display is a huge rabbit hole usually, much more complex than you’d think. But again, if your issue is politely worded I will be glad that someone tries to use my code and will try to help you. For example, even attaching screenshots of how other plotting packages handle what doesn’t work for you, like you did here, can be quite helpful.

17 Likes

Nice plots. A bit off topic, but it looks like you are doing structural bioinformatics - you could consider using BioStructures.jl, let me know if there is any functionality you want adding.

1 Like

Thank you for all your helpful comments. I’ve had opened a few issues in Plots.jl. I hope the problems I faced would eventually help future users.

2 Likes