Confusing plot titles with subplots

Hello! I am trying to create a few rows of subplots, each row containing the same number of subplots as well as a title. I have done this with nested plots of lists.

using Plots

x = 0:0.01:10

n = 3
m = 5

plots = []

for i in 1:m
    ps = []
    for j in 1:n
        y = sin.(j*i*x/2pi)
        p = plot(x, y)
        push!(ps, p)
    pp = plot(ps..., layout=(1, n), plot_title="Row number $(i)")
    push!(plots, pp)

plot(plots..., layout=(m,1), legend=false)

This works well, except for one thing. The row titles should number up, each saying Row number $(i). However, the top title does not say Row number 1, but rather is the same as the bottom title (in the above case, it says Row number 5. One can plot the elements of plots individually, and the first element will indeed have the title Row number 1. I do not understand why this happens, and I do not know how to fix it. Any help is appreciated.

Thats should be fixed on current Plots#master, upcoming version 1.30.2.

1 Like