If using PGFPlotsX for multiple figures, make sure you are not generating one figure per pdf but instead put multiple figures into the same pdf. As an example:
x = range(-1; stop = 1, length = 51);
axises = [@pgf Axis(
{
xmajorgrids,
ymajorgrids,
},
Plot(
{
no_marks,
},
Coordinates(x, 1 ./ (x.-i))
)
)
for i in 1:10];
@time for (i, axis) in enumerate(axises)
pgfsave("file_$i.pdf", axis)
end
# ~ 5 seconds
td = TikzDocument([TikzPicture(axis) for axis in axises]);
@time pgfsave("file.pdf", td);
# ~0.8 seconds
You can then easily split out the individual plots from the pages of the pdf.