# Any package for plots in style of Scientific Journals?

**URL:** <https://discourse.julialang.org/t/any-package-for-plots-in-style-of-scientific-journals/135378>\
**Category:** Visualization\
**Tags:** plotting, publications\
**Created:** [February 1, 2026, 1:27am UTC](https://discourse.julialang.org/t/any-package-for-plots-in-style-of-scientific-journals/135378 "2026-02-01T01:27:09Z")\
**Posts on this page:** 14\
**Page:** 2

<div class="post-metadata">

**Author:** ![CosmoProf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cosmoprof/32/15516_2.png) [@CosmoProf](https://discourse.julialang.org/u/CosmoProf)\
**Post date:** [February 10, 2026, 11:47pm UTC](https://discourse.julialang.org/t/any-package-for-plots-in-style-of-scientific-journals/135378/21 "2026-02-10T23:47:21Z")

</div>

Hi again folks, now I’m stumped on getting a stacked bar graph (after several attempts). I had one in the regular Plots package, does anyone know how to translate the following (successful code) into Makie:

```julia-auto
MyBarGraphPlot = groupedbar(
  [DataArray1 DataArray2],
  bar_position = :stack,
  bar_width=0.5,
  xlabel = "x", ylabel = "y",
  label=["DataSet1" "DataSet2"],
);
display(MyBarGraphPlot)

```

Thank you!

---

<div class="post-metadata">

**Author:** ![PeterSimon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petersimon/32/25193_2.png) [@PeterSimon](https://discourse.julialang.org/u/PeterSimon)\
**Post date:** [February 10, 2026, 11:56pm UTC](https://discourse.julialang.org/t/any-package-for-plots-in-style-of-scientific-journals/135378/22 "2026-02-10T23:56:42Z")

</div>

See several examples in [this section](https://docs.makie.org/dev/reference/plots/barplot) of the Makie documentation.

---

<div class="post-metadata">

**Author:** ![technocrat](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/technocrat/32/220947_2.png) [@technocrat](https://discourse.julialang.org/u/technocrat)\
**Post date:** [February 11, 2026, 12:29am UTC](https://discourse.julialang.org/t/any-package-for-plots-in-style-of-scientific-journals/135378/23 "2026-02-11T00:29:01Z")

</div>

> [@CosmoProf](#):
>
> ```julia-auto
> MyBarGraphPlot = groupedbar(
> [DataArray1 DataArray2],
> bar_position = :stack,
> bar_width=0.5,
> xlabel = "x", ylabel = "y",
> label=["DataSet1" "DataSet2"],
> );
> display(MyBarGraphPlot)
> 
> ```

```using

# Fake data
categories = 1:6
DataArray1 = [4.0, 7.0, 3.0, 8.0, 5.0, 6.0]
DataArray2 = [3.0, 2.0, 5.0, 4.0, 6.0, 3.0]

fig = Figure()
ax = Axis(fig[1, 1], xlabel = "x", ylabel = "y")

# Stacked bars: DataSet1 on bottom, DataSet2 on top
barplot!(ax, categories, DataArray1,
    label = "DataSet1", color = :steelblue, width = 0.5)
barplot!(ax, categories, DataArray2,
    offset = DataArray1, label = "DataSet2", color = :orange, width = 0.5)

axislegend(ax)

fig

```

 ![display](https://global.discourse-cdn.com/julialang/original/3X/a/3/a3364f3255267bb30d1e710698481ed50fa3b445.png)

---

<div class="post-metadata">

**Author:** ![CosmoProf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cosmoprof/32/15516_2.png) [@CosmoProf](https://discourse.julialang.org/u/CosmoProf)\
**Post date:** [February 11, 2026, 6:29am UTC](https://discourse.julialang.org/t/any-package-for-plots-in-style-of-scientific-journals/135378/24 "2026-02-11T06:29:13Z")

</div>

Thanks technocrat,that works very well!  
The only issue is that the marker titles are overlapping each other:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/7/6/766c07a66711661d4aebefeee659d67d82a9b08b.png)

I’m trying commands like this, but no fix found yet:

```julia-auto
axislegend(ax, position = :rt, framevisible = true, patchsize = (9, 15), patchlabelgap = 1.0)

```

(Also tried `padding`, didn’t help.)

Note that I am wrapping my barplot in:  
`with_theme(theme_aps(), figure_padding = (4, 4, 4, 4)) do ` block.

---

<div class="post-metadata">

**Author:** ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)\
**Post date:** [February 11, 2026, 6:42am UTC](https://discourse.julialang.org/t/any-package-for-plots-in-style-of-scientific-journals/135378/25 "2026-02-11T06:42:52Z")

</div>

> [@CosmoProf](#):
>
> is super-fiddly (everything has a different keyword to be adjusted).

This is why there are multiple plotting packages in Julia. They cater for different needs and have different philosophies. The Makie package is inspired I think a lot by matplotlib. It is very powerful, creates beautiful results and gives you a high degree of control, but the syntax is somewhat cumbersome. I personally do not use Makie for this reason, unless I have a very specific use case. The Plots package is very different - it is narrowly focused on making it easy and seamless for users to create plots, at the cost of somewhat less customisability and control.

---

<div class="post-metadata">

**Author:** ![technocrat](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/technocrat/32/220947_2.png) [@technocrat](https://discourse.julialang.org/u/technocrat)\
**Post date:** [February 11, 2026, 6:53am UTC](https://discourse.julialang.org/t/any-package-for-plots-in-style-of-scientific-journals/135378/26 "2026-02-11T06:53:28Z")

</div>

> [@CosmoProf](#):
>
> ```julia-auto
> axislegend(ax, position = :rt, framevisible = true, patchsize = (9, 15), patchlabelgap = 1.0)
> 
> ```

Try adding labelsize to set the font size smaller. The trick getting a happy medium between plain makie defaults and using a theme setup such as this is to pick a spot in the continuum and use that consistently or you’ll find yourself asking if it wouldn’t. be better to save to svg and do the microtuning in a vector editor.

---

<div class="post-metadata">

**Author:** ![CosmoProf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cosmoprof/32/15516_2.png) [@CosmoProf](https://discourse.julialang.org/u/CosmoProf)\
**Post date:** [February 11, 2026, 10:22pm UTC](https://discourse.julialang.org/t/any-package-for-plots-in-style-of-scientific-journals/135378/27 "2026-02-11T22:22:02Z")

</div>

Thanks again, `labelsize` did fix the words in the barplot legend! But, the legend marker boxes still stick together & are too big. I could not fix it with `markersize`, `labelsize`, `patchsize`, or `patchlabelgap`. Here is an example of the code (modified from your example) & results:

```julia-auto
# Fake data
categories = 1:6
DataArray1 = [4.0, 7.0, 3.0, 8.0, 2.0, 1.0]
DataArray2 = [3.0, 2.0, 5.0, 4.0, 1.0, 2.0]
#
with_theme(theme_aps(), figure_padding = (4, 4, 4, 4)) do 
    #
    fig = Figure()
    ax = Axis(fig[1, 1], xlabel = "x", ylabel = "y")
    #
    # Stacked bars: DataSet1 on bottom, DataSet2 on top
    Makie.barplot!(ax, categories, DataArray1, width = 0.5,
        label = "DataSet1" => (; markersize = 4, strokecolor = :black, strokewidth = 0.5))
    Makie.barplot!(ax, categories, DataArray2, offset = DataArray1, width = 0.5,
        label = "DataSet2" => (; markersize = 4, strokecolor = :black, strokewidth = 0.5))
    #
    ### Makie.axislegend(ax, position = :rt, framevisible = true, patchsize = (9, 15), patchlabelgap = 1.0)
    Makie.axislegend(ax, position = :rt, framevisible = true, labelsize = 8.25,
        padding = (-4.0, 2.5, -2.0, -2.0), patchsize = (9, 20), patchlabelgap = 2.0)
#
fig
#
end

```

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

Hopefully there is some parameter which can adjust this, because the “microtuning in a vector editor” sounds like an awful task (with a brand new learning curve). Thanks!

---

<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:** [February 11, 2026, 10:30pm UTC](https://discourse.julialang.org/t/any-package-for-plots-in-style-of-scientific-journals/135378/28 "2026-02-11T22:30:17Z")

</div>

Did you try to add two labels and remove the current text?

> **[Label | Makie](https://docs.makie.org/stable/reference/blocks/label)**
>
> Create impressive data visualizations with Makie, the plotting ecosystem for the Julia language. Build aesthetic plots with beautiful customizable themes, control every last detail of publication quality vector graphics, assemble complex layouts and...

There should be a way to position text freely in Makie. I used code like this, for example:

```julia
    label3 = Label(fig, "time_lapse", bbox=fig.scene.viewport)
    label3.halign[]=:left
    label3.valign[]=:top
    label3.alignmode=Outside(160, 0, 0, 100)

```

If you add two labels, you should be able to position them freely.

---

<div class="post-metadata">

**Author:** ![CosmoProf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cosmoprof/32/15516_2.png) [@CosmoProf](https://discourse.julialang.org/u/CosmoProf)\
**Post date:** [February 11, 2026, 10:38pm UTC](https://discourse.julialang.org/t/any-package-for-plots-in-style-of-scientific-journals/135378/29 "2026-02-11T22:38:19Z")

</div>

I did not try that, it sounds clever, but I do not know how to put two different `axislegend` commands into a single `with_theme do` block. Do you think you could integrate your idea into the sample code I included in my previous message? Thanks!

---

<div class="post-metadata">

**Author:** ![technocrat](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/technocrat/32/220947_2.png) [@technocrat](https://discourse.julialang.org/u/technocrat)\
**Post date:** [February 11, 2026, 11:33pm UTC](https://discourse.julialang.org/t/any-package-for-plots-in-style-of-scientific-journals/135378/30 "2026-02-11T23:33:51Z")

</div>

Try

> Makie.axislegend(ax, position = :rt, framevisible = true, labelsize = 8.25,  
> padding = (-4.0, 2.5, -2.0, -2.0), patchsize = (9, 20), patchlabelgap = 2.0,  
> patchstrokewidth = 0)  
> This follows Tufte’s principle that every pixel should contribute something, in this case to make the legend useful. Right now the boxes are superficial decoration—you can “see” both the colors and their labels without them.

---

<div class="post-metadata">

**Author:** ![CosmoProf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cosmoprof/32/15516_2.png) [@CosmoProf](https://discourse.julialang.org/u/CosmoProf)\
**Post date:** [February 12, 2026, 12:36am UTC](https://discourse.julialang.org/t/any-package-for-plots-in-style-of-scientific-journals/135378/31 "2026-02-12T00:36:41Z")

</div>

Oddly, `patchstrokewidth` doesn’t seem to do anything at all, whether its there or not there, set to zero or any other value.

The boxes in the legend seem to be controlled by the `label = "DataSet1" => (; etc., strokewidth = 0.5))` options in the `barplot!` command, and changing or getting rid of those lines doesn’t fix the size-of-the-colorful-rectangles problem.

---

<div class="post-metadata">

**Author:** ![technocrat](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/technocrat/32/220947_2.png) [@technocrat](https://discourse.julialang.org/u/technocrat)\
**Post date:** [February 12, 2026, 12:55am UTC](https://discourse.julialang.org/t/any-package-for-plots-in-style-of-scientific-journals/135378/32 "2026-02-12T00:55:56Z")

</div>

Apologies, I was too lazy to load the themes package. This should be the last in this thread because good hygiene limits the number of “post-solution” replies. Just link to the previous thread for context.

```julia-auto
using CairoMakie
# Fake data
categories = 1:6
DataArray1 = [4.0, 7.0, 3.0, 8.0, 5.0, 6.0]
DataArray2 = [3.0, 2.0, 5.0, 4.0, 6.0, 3.0]

fig = Figure()
ax = Axis(fig[1, 1], xlabel = "x", ylabel = "y")
barplot!(ax, categories, DataArray1,
    label = "DataSet1", color = :steelblue, width = 0.5)
barplot!(ax, categories, DataArray2,
    offset = DataArray1, label = "DataSet2", color = :orange, width = 0.5)
axislegend(ax; framevisible = false)

fig

```

 ![CleanShot 2026-02-11 at 16.55.35@2x](https://global.discourse-cdn.com/julialang/original/3X/e/0/e0cbcd0d71ddda3b692b0bcf02d4f0c2f1963f20.png)

---

<div class="post-metadata">

**Author:** ![CosmoProf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cosmoprof/32/15516_2.png) [@CosmoProf](https://discourse.julialang.org/u/CosmoProf)\
**Post date:** [February 12, 2026, 4:57am UTC](https://discourse.julialang.org/t/any-package-for-plots-in-style-of-scientific-journals/135378/33 "2026-02-12T04:57:42Z")

</div>

Ok then… just, this solution still does not work in the `with_theme(theme_aps()) do` wrapper.  
So I don’t have a solution yet. I guess I’ll start a new thread for this, or make do with what I have.

---

<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:** [February 12, 2026, 7:59am UTC](https://discourse.julialang.org/t/any-package-for-plots-in-style-of-scientific-journals/135378/34 "2026-02-12T07:59:37Z")

</div>

> [@CosmoProf](#):
>
> `axislegend` commands into a single `with_theme do` block

You do not need two `axislegend` calls. Just `legend`.

[Previous page](https://discourse.julialang.org/t/any-package-for-plots-in-style-of-scientific-journals/135378.md?page=1)
