There is also a pretty easy Julia workaround, at least with CairoMakie:
Generate test plots
let
mkpath("OldFigs")
mkpath("NewFigs")
x = LinRange(0,2pi,100)
funcs = (sin, cos, exp)
for f in funcs
fig = Figure(resolution = 350 .*(2.,1.3),fontsize = 20)
ax = Axis(fig[1,1])
lines!(ax,x,f.(x),)
save("OldFigs/$(string(f)).pdf",current_figure())
end
for f in funcs
fig = Figure(resolution = 350 .*(2.,1.3),fontsize = 20)
ax = Axis(fig[1,1])
lines!(ax,x,f.(x/2),)
save("NewFigs/$(string(f)).pdf",current_figure())
end
end
# This is the actual function that makes the comparison plot
using CairoMakie, FileIO, ImageMagick #ImageMagick seems to be neccessary for pdfs
function PicturesComparison(OldPath,NewPath)
files1 = readdir(OldPath)
files2 = readdir(NewPath)
names = files1 ∩ files2
fig = Figure(resolution = 800 .*(1,0.4*length(names)))
axkwargs = (;
xticklabelsvisible = false,
xticksvisible = false,
yticklabelsvisible = false,
yticksvisible = false,
spinewidth = 0.,
xgridvisible = false,
ygridvisible = false,
aspect = DataAspect(),
)
OldAx = [Axis(fig[i,1],title = n;axkwargs...) for (i,n) in enumerate(names)]
NewAx = [Axis(fig[i,2];axkwargs...) for (i,n) in enumerate(names)]
for (i,n) in enumerate(names)
for (j,p) in enumerate((OldPath,NewPath))
img = rotr90(load(joinpath(p,n)))
ax = [OldAx,NewAx][j][i]
image!(ax,img)
end
end
fig
end
PicturesComparison("OldFigs","NewFigs")
This produces the plot