# \`Plots\` or otherwise?

**URL:** <https://discourse.julialang.org/t/plots-or-otherwise/104162>\
**Category:** Visualization\
**Tags:** question, plotting\
**Created:** [September 22, 2023, 6:06pm UTC](https://discourse.julialang.org/t/plots-or-otherwise/104162 "2023-09-22T18:06:54Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryofurue](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ryofurue/32/24531_2.png) [@ryofurue](https://discourse.julialang.org/u/ryofurue)\
**Post date:** [September 22, 2023, 6:06pm UTC](https://discourse.julialang.org/t/plots-or-otherwise/104162/1 "2023-09-22T18:06:54Z")

</div>

After 1.5 years of Julia experience, I now write almost everything in Julia. I used to use Bourne shell, Ruby, Fortran, and a bit of Haskell, but I don’t need these any longer. **Except** I don’t know which plotting package is the right one for me. (And except for some things that Haskell does very well, like lazy recursion.)

When I started Julia, I read one of the official Julia webpages, which said that `Plot` is the unified interface and you can switch backends to suit your needs. I thought, that’s a great idea!

So, since then, I’ve been exclusively using `Plots`. It’s much more elegant and easier to use than “traditional” plotting methods common in other languages and environments.

But I found it sometimes very hard to find information about `Plots`. I search Google and Julia Discourse, but almost always the information I find is exclusive to a particular package, like Makie and Matplotlib. The syntax I find there is totally different from `Plots`’s.

So, my question No.1 is: Is it possible to mix two ways?

```julia
using Plots
use_somebackend()
p = plot( . . . )
function_specific_to_the_backend(p, . . .) # or something like this.

```

Also, sometimes I ask questions about plotting in this forum and I often get an answer like “package X can do that” and I end up not knowing how to replicate it in `Plots` with X as the backend.

I don’t know whether it’s a problem of documentation of `Plots` or whether the capability isn’t accessible form `Plots`. I don’t think I understand the architecture of `Plots`.

I’m not talking about large things like contouring. I know contouring is available in `Plots`. I’m talking about smaller things, like having three or more y axes for a single graph, specifying the absolute positions of the axes, controlling the the precision of numeric labels, specifying fonts of the letterings, plotting an arbitrary polygons and arrows on an existing plot, open-ended contouring levels, specifying exact colors for contour levels, extending plot elements outside the plotting rectangle, availability of geographical maps (country boundaries, elevation of land surface, etc.) without plotting maps myself, availability of map projections, etc., etc.

These aren’t big things, but I need them and since I’m not able to find out how to do these with `Plots`, I give up Julia for producing figures and go back to an old plotting program I’m familiar with and have almost total control of.

I feel defeated.

So, my question No. 2 is, does `Plots` do almost everything and is it just a documentation problem? Or is it that `Plots` is still very young and its future is promising even if it doesn’t have those capabilities now? Or should I find a suitable package to me and learn its specific ways?

Then, supposing I’ll be migrating to another package, I still find it hard to decide on which one I should explore. Because I need to plot geographical maps, I search for it and find that `GMT.jl` seems to be a great package. But when I search for other capabilities, sometimes `Makie.jl` and sometimes another package, etc.

I’m a full-time researcher and I use programming languages and tools for my scientific work. I don’t have too much time to explore various packages before I decide on which one to go with.

* * *

As an aside . . . I’m the only Julia user among my colleagues as far as I know. A large fraction of my colleagues use Python or are switching to Python. It seems all of them use one well known plotting package. Is it called matplotlib? I then look over what matplotlib looks like and am dismayed to see its . . . how to put it . . . complicated user interface. I’m attracted to Julia, Ruby, and Haskell because of their elegance. The `Plots` package suits Julia very well.

Python just works but it doesn’t look fun to program in it. As far as I can tell from the tutorials, matplotlib looks like it’s not much fun.

---

<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:** [September 22, 2023, 6:20pm UTC](https://discourse.julialang.org/t/plots-or-otherwise/104162/2 "2023-09-22T18:20:40Z")

</div>

> [@ryofurue](#):
>
> I’m talking about smaller things, like having three or more y axes for a single graph, specifying the absolute positions of the axes, controlling the the precision of numeric labels, specifying fonts of the letterings, plotting an arbitrary polygons and arrows on an existing plot, open-ended contouring levels, specifying exact colors for contour levels, extending plot elements outside the plotting rectangle

Most of these are hard to offer with a unified syntax over multiple different backends because their implementations or APIs in the backends themselves differ so much. That’s why Plots doesn’t cover every possible feature, but a subset.

---

<div class="post-metadata">

**Author:** ![goerz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/goerz/32/3269_2.png) [@goerz](https://discourse.julialang.org/u/goerz)\
**Post date:** [September 22, 2023, 6:22pm UTC](https://discourse.julialang.org/t/plots-or-otherwise/104162/3 "2023-09-22T18:22:01Z")

</div>

> [@ryofurue](#):
>
> `Plots` do almost everything and is it just a documentation problem?

No `Plots` definitely doesn’t do everything. Personally, I’ve found `Plots` to be the perfect plotting package for exploration. That is, to quickly look at things while I’m doing research, e.g., in a Jupyter Notebook. The package syntax is just very short and flexible. The multiple backends also come in handy. One of my favorites is [UnicodePlots](https://github.com/JuliaPlots/UnicodePlots.jl), which I love to use as part of running package tests in the terminal (but then switch to a different backend if I really need to see details).

However, `Plots` is not very good when you need extreme customization, most likely for generating plots for published papers. Personally, I’m still finding Python’s [matplotlib](https://matplotlib.org) unsurpassed, although [Makie](https://makie.org) [looks interesting](https://discourse.julialang.org/t/how-customizable-is-makie/101185) if you’re looking for something in pure Julia.

---

<div class="post-metadata">

**Author:** ![abraemer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/abraemer/32/51403_2.png) [@abraemer](https://discourse.julialang.org/u/abraemer)\
**Post date:** [September 22, 2023, 8:49pm UTC](https://discourse.julialang.org/t/plots-or-otherwise/104162/4 "2023-09-22T20:49:30Z")

</div>

I agree with @goerz . I use Plots.jl in my everyday programming/exploration but switch to PyPlot.jl (which is a one-to-one wrapper of matplotlib in Python) when I need to create publication-grade figures. I am quite curious about Makie.jl and have heard a lot good things and keep telling myself that I will try next time but that hasn’t happened so far 😅

[Here](https://discourse.julialang.org/t/comparison-of-plotting-packages/99860/2) is a really good summary/comparison of the different plotting packages.

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [September 23, 2023, 2:50am UTC](https://discourse.julialang.org/t/plots-or-otherwise/104162/5 "2023-09-23T02:50:43Z")

</div>

I tried many packages, and for 2D publication ready plots I switched back to PythonPlot.jl [GitHub - JuliaPy/PythonPlot.jl: Plotting for Julia based on matplotlib.pyplot](https://github.com/JuliaPy/PythonPlot.jl) which is basically Matplotlib.

It is very mature, provides high quality 2D plots and it is easy to find documentation.

Only for 3D plots and animations I use Makie.jl

---

<div class="post-metadata">

**Author:** ![ryofurue](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ryofurue/32/24531_2.png) [@ryofurue](https://discourse.julialang.org/u/ryofurue)\
**Post date:** [September 23, 2023, 5:16am UTC](https://discourse.julialang.org/t/plots-or-otherwise/104162/6 "2023-09-23T05:16:42Z")

</div>

Thank you all for your inputs! It seems that this

> [@goerz](#):
>
> I’ve found `Plots` to be the perfect plotting package for exploration.  
> . . .  
> However, `Plots` is not very good when you need extreme customization, most likely for generating plots for published papers.

is the consensus. That makes sense. I’ve been struggling to customize my plots for publication, but I use `Plots` quite often just to explore or to debug.

> [@goerz](#):
>
> although [Makie](https://makie.org) [looks interesting](https://discourse.julialang.org/t/how-customizable-is-makie/101185) if you’re looking for something in pure Julia.

Thank you for that! The top page of `Makie` shows a few plots from my research field (meteorology, oceanography, climate science)!

Perhaps I’ll explore `Makie` first and if I’m defeated, I’ll come back to `PyPlot.jl` or `PythonPlot.jl` (What’s the difference between the two packages?).

---

<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:** [September 23, 2023, 7:13am UTC](https://discourse.julialang.org/t/plots-or-otherwise/104162/7 "2023-09-23T07:13:27Z")

</div>

> [@ryofurue](#):
>
> Perhaps I’ll explore `Makie` first and if I’m defeated

Please file issues when you’re missing features 🙂 matplotlib due to its age and userbase has many niche use cases covered and I like to check those off one by one for Makie

---

<div class="post-metadata">

**Author:** ![Paul\_Soderlind](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/paul_soderlind/32/1753_2.png) [@Paul\_Soderlind](https://discourse.julialang.org/u/Paul_Soderlind)\
**Post date:** [September 23, 2023, 7:29am UTC](https://discourse.julialang.org/t/plots-or-otherwise/104162/8 "2023-09-23T07:29:28Z")

</div>

> (What’s the difference between the two packages?).

One uses PyCall (earlier) the other PythonCall (newer). Otherwise, virtually identical.

---

<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:** [September 23, 2023, 9:16am UTC](https://discourse.julialang.org/t/plots-or-otherwise/104162/9 "2023-09-23T09:16:57Z")

</div>

Hi, about plot quality, customizations etc and using in publications, I would like to point out that the GMT papers listed here

> **[Citing](https://www.generic-mapping-tools.org/cite/)**
>
> The swiss army knife of geoscience

have collected in total some ~13500 citations.

---

<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:** [September 23, 2023, 9:29am UTC](https://discourse.julialang.org/t/plots-or-otherwise/104162/10 "2023-09-23T09:29:00Z")

</div>

Publication quality may mean many things (features or font control, etc), but for the most typical publication plots I find the default Plots + GR [with some customization](https://m3g.github.io/JuliaNotes.jl/stable/figures/) options quite satisfactory, and I didn’t feel the need to move to something else for the moment:

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

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

(from [here](https://github.com/m3g/ComplexMixtures.jl))

ps: I don’t need all the resources you mentioned there, for sure.

---

<div class="post-metadata">

**Author:** ![jd-foster](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jd-foster/32/35824_2.png) [@jd-foster](https://discourse.julialang.org/u/jd-foster)\
**Post date:** [September 23, 2023, 11:17am UTC](https://discourse.julialang.org/t/plots-or-otherwise/104162/11 "2023-09-23T11:17:30Z")

</div>

I hope you’ll consider `plotly` too, either through PlotyJS.jl, the more light-weight PlotyLight.jl or in conjunction with those as a customistion step after using the backend via Plots.jl. I personally find it intuitive as a researcher who wants to get the job done, and it covers all the things you mentioned including some quick ways to do geographic plots. If you have any questions at all, feel free to get in contact here.

---

<div class="post-metadata">

**Author:** ![ryofurue](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ryofurue/32/24531_2.png) [@ryofurue](https://discourse.julialang.org/u/ryofurue)\
**Post date:** [September 23, 2023, 5:57pm UTC](https://discourse.julialang.org/t/plots-or-otherwise/104162/12 "2023-09-23T17:57:49Z")

</div>

> [@lmiq](#):
>
> Publication quality may mean many things (features or font control, etc), but for the most typical publication plots I find the default Plots + GR [with some customization](https://m3g.github.io/JuliaNotes.jl/stable/figures/) options quite satisfactory,

I should’ve mentioned that I’ve already published a scientific paper that includes a few line graphs (similar to the one you show) which I plotted with the `Plots` package 😄

When I talk about “publication quality”, I certainly agree that the quality of plots from the `Plots` package is high, higher than those I’ve produced with other tools.

But that kind of “qtuality” isn’t what I’m after. I’ve hit the wall of customizability with `Plots`. That is, I need a different kind of “quality”.

> [@](#):
>
> and I didn’t feel the need to move to something else for the moment:

To me, the current show stoppers of `Plots` are 1) the inability (or difficulty, I can’t tell which) of producing publication quality contour plots with open-ended contour intervals and 2) the inability of specifying the absolute positions of the axes. The margins can be precisely controlled but the axes shift depending on the letterings (labels) plotted outside the axes. I often need to align separately plotted figures and graphs but if the positions and lengths of the axes are different between the plots, the alignment requires a tedious trial-and-error.

For problem (1), I’ve found the PlotLy backend kind of produces not-too-bad plots, except that I can’t save them to image files because of a bug (it’s reported but taking some time). Then, I switched to another backend (pyplot?), which plotted a fine contour plot with open ended levels, but its contouring was with continuous color shading and without contour lines . . . Then I didn’t know how to get discrete color levels and also I had to manually overlay contour lines . . . You see, there is **so much** work before you get what you need.

I’ll likely discover other showstoppers as/if I keep using `Plots`. As I said in my initial posting, whenever a problem of customizability occurs, I search the net and Discourse, and was defeated in many cases.

Initially my `Plot` skill grew rapidly, but for this half year, it has stopped growing, having not been able to solve my problems.

---

<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:** [September 23, 2023, 7:33pm UTC](https://discourse.julialang.org/t/plots-or-otherwise/104162/13 "2023-09-23T19:33:31Z")

</div>

> [@ryofurue](#):
>
> plots with open-ended contour intervals

Sorry, would mind explain in more detail whay you mean here?

---

<div class="post-metadata">

**Author:** ![ryofurue](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ryofurue/32/24531_2.png) [@ryofurue](https://discourse.julialang.org/u/ryofurue)\
**Post date:** [September 23, 2023, 7:43pm UTC](https://discourse.julialang.org/t/plots-or-otherwise/104162/14 "2023-09-23T19:43:50Z")

</div>

> plots with open-ended contour intervals

If there is an easy way to upload an image, please tell me.

In words . . . suppose you have a 2D variable which ranges from -100 to 100, but you want to make a contour plot over -10 to 10 and you want to paint -100 to -10 with the lower extreme color and 10 to 100 with the higher extreme color. The colorbar must indicate the fact. The most common way is to have a little downward pointing triangle for the -100 to -10 range and an upward pointing triangle for the 10 to 100 range at the lower and upper ends of the colorbar.

In other words, I need contour levels of [-Inf, -10, -8, -6, . . . , 6, 8, 10, Inf] and I need the colorbar to indicate the fact. In my field, the standard plotting programs automatically do this.

I’ve submitted a feature request to the `Plots` package github to implement this feature for the GR backend.

---

<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:** [September 23, 2023, 7:44pm UTC](https://discourse.julialang.org/t/plots-or-otherwise/104162/15 "2023-09-23T19:44:26Z")

</div>

> [@ryofurue](#):
>
> To me, the current show stoppers of `Plots` are 1) the inability (or difficulty, I can’t tell which) of producing publication quality contour plots with open-ended contour intervals and 2) the inability of specifying the absolute positions of the axes.

I don’t understand what 1) means, but for 2) and for maximum publication quality in general, anything that produces pgfplots/LaTeX plots, like for example Pgfplotsx.jl, is unmatched. At least if by “publication quality” you are talking about LaTeX.

---

<div class="post-metadata">

**Author:** ![ryofurue](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ryofurue/32/24531_2.png) [@ryofurue](https://discourse.julialang.org/u/ryofurue)\
**Post date:** [September 23, 2023, 7:49pm UTC](https://discourse.julialang.org/t/plots-or-otherwise/104162/16 "2023-09-23T19:49:44Z")

</div>

> [@DNF](#):
>
> I don’t understand what 1) means, but for 2) and for maximum publication quality in general, anything that produces pgfplots/LaTeX plots, like for example Pgfplotsx.jl, is unmatched. At least if by “publication quality” you are talking about LaTeX.

So, you don’t understand (2), either. Perhaps we should stop using the term “publication quality” altogether. Please go back to one of my previous posts to see what I mean by (2). I need to control the absolute positions of the axes from the edge of the produced image.

It’s not a quality issue. Let’s agree on that. It’s the lack of capability.

---

<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:** [September 23, 2023, 7:51pm UTC](https://discourse.julialang.org/t/plots-or-otherwise/104162/17 "2023-09-23T19:51:59Z")

</div>

> [@ryofurue](#):
>
> So, you don’t understand (2), either.

How can you tell that I don’t understand 2), I just said that pgfplots solves it, I didn’t explain what I thought ‘it’ was. Please re-read the sentence.

---

<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:** [September 23, 2023, 7:54pm UTC](https://discourse.julialang.org/t/plots-or-otherwise/104162/18 "2023-09-23T19:54:13Z")

</div>

> [@ryofurue](#):
>
> 1. the inability of specifying the absolute positions of the axes. The margins can be precisely controlled but the axes shift depending on the letterings (labels) plotted outside the axes. I often need to align separately plotted figures and graphs but if the positions and lengths of the axes are different between the plots, the alignment requires a tedious trial-and-error.

This is what pgfplots solves. It allows aligning axes, disregarding labels, ticks, etc.

---

<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:** [September 23, 2023, 8:23pm UTC](https://discourse.julialang.org/t/plots-or-otherwise/104162/19 "2023-09-23T20:23:29Z")

</div>

> [@ryofurue](#):
>
> I search for it and find that `GMT.jl` seems to be a great package.

Have you really look at it? Because it can do all the things you mentioned here.

---

<div class="post-metadata">

**Author:** ![ryofurue](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ryofurue/32/24531_2.png) [@ryofurue](https://discourse.julialang.org/u/ryofurue)\
**Post date:** [September 23, 2023, 9:09pm UTC](https://discourse.julialang.org/t/plots-or-otherwise/104162/20 "2023-09-23T21:09:25Z")

</div>

> Have you really look at it? Because it can do all the things you mentioned here.

I believe you. No, I haven’t looked at it carefully.

But, I don’t understand what you intend by that question. I didn’t dismiss `GMT.jl`.

All I’m saying is, I haven’t been able to find out how to produce what I need with `Plots.jl`. And I showed a few examples of that (because one person said that `Plots.jl’ is good enough.) That’s all.

Then, you folks indicate what I need can be accomplished by packages X, Y, Z, etc.

So, there is probably misunderstanding.

I’m **not** saying that what I want cannot be done by the existing packages. I expect what I need can be done by any graphics packages. That’s why I’m frustrated with `Plots.jl` in the first place.

[Next page](https://discourse.julialang.org/t/plots-or-otherwise/104162.md?page=2)
