# Why Plots.jl produce figures looks not as good as other packages even with pyplot

**URL:** <https://discourse.julialang.org/t/why-plots-jl-produce-figures-looks-not-as-good-as-other-packages-even-with-pyplot/74946>\
**Category:** New to Julia\
**Tags:** plotting, plots\
**Created:** [January 20, 2022, 4:27pm UTC](https://discourse.julialang.org/t/why-plots-jl-produce-figures-looks-not-as-good-as-other-packages-even-with-pyplot/74946 "2022-01-20T16:27:04Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fred\_He](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fred_he/32/14298_2.png) [@Fred\_He](https://discourse.julialang.org/u/Fred_He)\
**Post date:** [January 20, 2022, 4:27pm UTC](https://discourse.julialang.org/t/why-plots-jl-produce-figures-looks-not-as-good-as-other-packages-even-with-pyplot/74946/1 "2022-01-20T16:27:05Z")

</div>

Add in 21.Jan.  
people are trying to tell me the style can be customized, but no one explains why the default style is not pretty at all.

And if you think the default is pretty just say it’s pretty. Don’t tell me that it can be customized, because customization doesn’t conflict with pretty default plotting.

* * *

Just look at one example in matplotlib, I produced in julia. Why did the developers choose to make the default figure like this?  
I mean, the one from matplotlib looks much better for publication, right?

![image](https://global.discourse-cdn.com/julialang/original/3X/6/f/6f76b93469deb8dc4bb6d97d0d12230952b360cf.png)  
 ![image](https://global.discourse-cdn.com/julialang/original/3X/a/5/a50f9f16a63027698c0ec1bb669b3fbe4f4c5081.png)

---

<div class="post-metadata">

**Author:** ![affans](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/affans/32/11911_2.png) [@affans](https://discourse.julialang.org/u/affans)\
**Post date:** [January 20, 2022, 4:29pm UTC](https://discourse.julialang.org/t/why-plots-jl-produce-figures-looks-not-as-good-as-other-packages-even-with-pyplot/74946/2 "2022-01-20T16:29:17Z")

</div>

I think it’s somewhat subjective. I myself don’t prefer `Plots.jl` nor `pyplot` but use `Gnuplot.jl` for all my plotting (plus it’s really powerful with a lot of features and basically no FTTP issue).

To answer your question directly, perhaps within `Plots.jl` there could be user-specific defaults setup (so in your case for example, the mirrored axis will go away).

---

<div class="post-metadata">

**Author:** ![Fred\_He](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fred_he/32/14298_2.png) [@Fred\_He](https://discourse.julialang.org/u/Fred_He)\
**Post date:** [January 20, 2022, 4:38pm UTC](https://discourse.julialang.org/t/why-plots-jl-produce-figures-looks-not-as-good-as-other-packages-even-with-pyplot/74946/3 "2022-01-20T16:38:05Z")

</div>

They do have the user-specified default setup. However, it takes some effort to find what are the keywords and what is the effect of each keywords.

But I took a look at the syntax of Gnuplot.jl and found Plots.jl is more user-friendly as i don’t have any experience of Gnuplot

---

<div class="post-metadata">

**Author:** ![affans](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/affans/32/11911_2.png) [@affans](https://discourse.julialang.org/u/affans)\
**Post date:** [January 20, 2022, 4:42pm UTC](https://discourse.julialang.org/t/why-plots-jl-produce-figures-looks-not-as-good-as-other-packages-even-with-pyplot/74946/4 "2022-01-20T16:42:14Z")

</div>

> [@Fred\_He](#):
>
> But I took a look at the syntax of Gnuplot.jl

It took me a while to get the basics (and I still mostly have to google it). There is a Julia friend wrapper around Gnuplot (check out [Home · Gaston.jl (mbaz.github.io)](https://mbaz.github.io/Gaston.jl/stable/) but as far as I know, it still dosn’t hook into the Plots.jl interface.

Don’t let me derail the conversation. Perhaps someone from Plots.jl can provide a comment on why certain defaults were chosen.

---

<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:** [January 20, 2022, 4:42pm UTC](https://discourse.julialang.org/t/why-plots-jl-produce-figures-looks-not-as-good-as-other-packages-even-with-pyplot/74946/5 "2022-01-20T16:42:49Z")

</div>

Matplotlib main advantage in your example is that it automatically places the legend away from the data. Plots.jl could default to place the legend outside the plot area.

Plots.jl’s default discrete light gray grid lines in the background are very useful to make the values easier to read. For example, we know that the quadratic reads 4 at x=2.

---

<div class="post-metadata">

**Author:** ![Fred\_He](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fred_he/32/14298_2.png) [@Fred\_He](https://discourse.julialang.org/u/Fred_He)\
**Post date:** [January 20, 2022, 4:53pm UTC](https://discourse.julialang.org/t/why-plots-jl-produce-figures-looks-not-as-good-as-other-packages-even-with-pyplot/74946/6 "2022-01-20T16:53:49Z")

</div>

I really want to know why some features are chosen. In the presented example, I think adding `box=:off , grid=:off, legend=:topleft, background_color_legend=nothing` makes the figure looks slightly better. But I think the thing makes the figure of matplotlib more elegant is maybe the transparent background of legend and the font size.  
 ![image](https://global.discourse-cdn.com/julialang/original/3X/1/7/17747dac4de99492b13bd4736a7c5d68af9189f4.png)

---

<div class="post-metadata">

**Author:** ![Fred\_He](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fred_he/32/14298_2.png) [@Fred\_He](https://discourse.julialang.org/u/Fred_He)\
**Post date:** [January 20, 2022, 4:59pm UTC](https://discourse.julialang.org/t/why-plots-jl-produce-figures-looks-not-as-good-as-other-packages-even-with-pyplot/74946/7 "2022-01-20T16:59:11Z")

</div>

The choice of having the gridlines or not is a personal preference. Figure with gridlines can be good looking, but Plots.jl clearly doesn’t provide.

---

<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:** [January 20, 2022, 5:05pm UTC](https://discourse.julialang.org/t/why-plots-jl-produce-figures-looks-not-as-good-as-other-packages-even-with-pyplot/74946/8 "2022-01-20T17:05:19Z")

</div>

I mean this is all just personal preference, isn’t it? Not much point arguing over it, just set your `default()`s as you like (or via your `startup.jl`)

---

<div class="post-metadata">

**Author:** ![tamasgal](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamasgal/32/27946_2.png) [@tamasgal](https://discourse.julialang.org/u/tamasgal)\
**Post date:** [January 20, 2022, 5:14pm UTC](https://discourse.julialang.org/t/why-plots-jl-produce-figures-looks-not-as-good-as-other-packages-even-with-pyplot/74946/9 "2022-01-20T17:14:51Z")

</div>

Yes, most of the things are personal preference, I fully agree. Also the choice of plotting library is quite a controversially topic in the Julia community. You ask 10 people and get 15 different answers 😉 I love and prefer `PGFPlotsX.jl` because that’s in my opinion the most mature and best documented feature-rich plotting library which produces publication-quality graphics (TeX). But as written above, whatever you like 😉

However, regarding the colours, there is one important thing: there are many colour blind people, so choose colours which are distinctive for the majority of the people.

Luckily, the default colours nowadays are pretty good, see below (if you don’t see a difference, you probably have deuteranomaly), the examples created with [Coblis — Color Blindness Simulator – Colblindor](https://www.color-blindness.com/coblis-color-blindness-simulator/)

![original](https://global.discourse-cdn.com/julialang/original/3X/8/f/8f0a0a5552c295145fb9de79369c525595060b88.png)  
 ![deuteranomaly](https://global.discourse-cdn.com/julialang/original/3X/c/3/c3647beef6350cdeaf0605e26f86aa22ecdbc962.png)

---

<div class="post-metadata">

**Author:** ![Fred\_He](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fred_he/32/14298_2.png) [@Fred\_He](https://discourse.julialang.org/u/Fred_He)\
**Post date:** [January 20, 2022, 5:14pm UTC](https://discourse.julialang.org/t/why-plots-jl-produce-figures-looks-not-as-good-as-other-packages-even-with-pyplot/74946/10 "2022-01-20T17:14:59Z")

</div>

some are personal preferences, some are not. A simple question, do you prefer to use the figure with default setting from Plots.jl for publication?

---

<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:** [January 20, 2022, 6:03pm UTC](https://discourse.julialang.org/t/why-plots-jl-produce-figures-looks-not-as-good-as-other-packages-even-with-pyplot/74946/11 "2022-01-20T18:03:53Z")

</div>

Why would you use the defaults for publication? That’s a straw man you’re building for a fight nobody is trying to have.

I like Plots, specifically _because_ it’s very configurable. Personally, I almost always do

```julia
default(;seriestype=:scatter, fontfamily="Computer Modern", label=nothing)

```

at the start of a script. If it’s important, I will also spend a little time choosing a good color scheme for my specific use case. But I’m not pretentious enough to think everyone shares my preferences.

The defaults are fine and the options are numerous.

---

<div class="post-metadata">

**Author:** ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Post date:** [January 20, 2022, 6:41pm UTC](https://discourse.julialang.org/t/why-plots-jl-produce-figures-looks-not-as-good-as-other-packages-even-with-pyplot/74946/12 "2022-01-20T18:41:42Z")

</div>

> [@Fred\_He](#):
>
> A simple question, do you prefer to use the figure with default setting from Plots.jl for publication?

I’d frequently used Plots.jl with the PGFPlots backend to produce figure with publication quality far superior to what matplotlib produces. You can use matplotlib2tikz for similar output, but matplotlib doesn’t really produce close to publication-quality figures out of the box in my opinion.

---

<div class="post-metadata">

**Author:** ![Fred\_He](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fred_he/32/14298_2.png) [@Fred\_He](https://discourse.julialang.org/u/Fred_He)\
**Post date:** [January 20, 2022, 7:10pm UTC](https://discourse.julialang.org/t/why-plots-jl-produce-figures-looks-not-as-good-as-other-packages-even-with-pyplot/74946/13 "2022-01-20T19:10:19Z")

</div>

I am surprised there are people defending the default plotting style.

Not why, just why not have the default plots that look like something is for publication.

Hope you can understand that a better default look doesn’t conflict with numerous options and configurability.

---

<div class="post-metadata">

**Author:** ![Fred\_He](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fred_he/32/14298_2.png) [@Fred\_He](https://discourse.julialang.org/u/Fred_He)\
**Post date:** [January 20, 2022, 7:14pm UTC](https://discourse.julialang.org/t/why-plots-jl-produce-figures-looks-not-as-good-as-other-packages-even-with-pyplot/74946/14 "2022-01-20T19:14:51Z")

</div>

But my point is that the default plot from Plots.jl clearly doesn’t look like something for publication.  
I cannot even put the default plot figures for the presentation to my supervisor. But I can accept to put the figure from matplotlib in the slides to my supervisor.

---

<div class="post-metadata">

**Author:** ![aplavin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aplavin/32/222056_2.png) [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Post date:** [January 20, 2022, 8:53pm UTC](https://discourse.julialang.org/t/why-plots-jl-produce-figures-looks-not-as-good-as-other-packages-even-with-pyplot/74946/15 "2022-01-20T20:53:52Z")

</div>

I agree with some points - eg the legend autoplacement in Plots.jl can indeed be improved to avoid lines. But at least some of those differences are definitely a matter of preferences. For example I always put grids on my plots, and have the corresponding option set in matplotlib config.

---

<div class="post-metadata">

**Author:** ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)\
**Post date:** [January 21, 2022, 2:05pm UTC](https://discourse.julialang.org/t/why-plots-jl-produce-figures-looks-not-as-good-as-other-packages-even-with-pyplot/74946/16 "2022-01-21T14:05:02Z")

</div>

5 posts were split to a new topic: [Making Plots place its legend in a better spot (with GR)](https://discourse.julialang.org/t/making-plots-place-its-legend-in-a-better-spot-with-gr/74986)

---

<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:** [January 20, 2022, 9:10pm UTC](https://discourse.julialang.org/t/why-plots-jl-produce-figures-looks-not-as-good-as-other-packages-even-with-pyplot/74946/17 "2022-01-20T21:10:31Z")

</div>

In any case, many Plots.jl’s defaults are quite good and output nicely in \*.svg or \*.pdf formats, for instance:

```julia
using Plots
plot(atanh ∘ cos ∘ abs2, label="atanh(cos(x²))")
savefig("Plots_gr_default.pdf")

```

 ![Plots_gr_default_pdf](https://global.discourse-cdn.com/julialang/original/3X/e/b/eb6b08632c6f76de02639a0234fc4f33068bd773.png)

The fact is that the diversity of possible inputs is so great that it is probably difficult to optimize it in all cases and for quality publications we have to adapt to the dataset in hand. Probably the defaults are defined for quick display (_no oversampling done for functions input as above, etc._)

---

<div class="post-metadata">

**Author:** ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Post date:** [January 20, 2022, 9:12pm UTC](https://discourse.julialang.org/t/why-plots-jl-produce-figures-looks-not-as-good-as-other-packages-even-with-pyplot/74946/18 "2022-01-20T21:12:09Z")

</div>

If you like matplotlib and its defaults, why don’t you just use PyPlot.jl instead of Plots.jl?

---

<div class="post-metadata">

**Author:** ![TI36XPro](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ti36xpro/32/33658_2.png) [@TI36XPro](https://discourse.julialang.org/u/TI36XPro)\
**Post date:** [January 21, 2022, 12:39am UTC](https://discourse.julialang.org/t/why-plots-jl-produce-figures-looks-not-as-good-as-other-packages-even-with-pyplot/74946/19 "2022-01-21T00:39:06Z")

</div>

I’m not sure the question can be answered in a meaningful way. Your preferences are likely different than mine which are different than the next person. The authors of the plotting packages get to decide what the defaults are - I think that is reasonable.

---

<div class="post-metadata">

**Author:** ![Fred\_He](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fred_he/32/14298_2.png) [@Fred\_He](https://discourse.julialang.org/u/Fred_He)\
**Post date:** [January 21, 2022, 8:44am UTC](https://discourse.julialang.org/t/why-plots-jl-produce-figures-looks-not-as-good-as-other-packages-even-with-pyplot/74946/20 "2022-01-21T08:44:47Z")

</div>

So do you mean the default plotting of Plots.jl is better than matplotlib?

[Next page](https://discourse.julialang.org/t/why-plots-jl-produce-figures-looks-not-as-good-as-other-packages-even-with-pyplot/74946.md?page=2)
