I need to export plots as PDF with a given image and font size. Everything is working fine if there is no legend for that plot. However, if I want to export legended plots, the font size is decreased in the exported PDF. Here is a small working example:
plotWithoutLegend =
ListPlot[Table[f, {f, {Sin[x], Cos[x]}}, {x, 0, 2 \[Pi], 0.1}],
Frame -> True, FrameLabel -> "Frame label font size is 12",
ImageSize -> 200, BaseStyle -> {FontSize -> 12}];
Export["plotWithoutLegend.pdf", plotWithoutLegend]
This yields the expected font size. However, when trying to export:
plotWithLegend =
ListPlot[Table[f, {f, {Sin[x], Cos[x]}}, {x, 0, 2 \[Pi], 0.1}],
Frame -> True, PlotLegends -> {"sin(x)", "cos(x)"},
FrameLabel -> "Frame label font size is about 8 pt",
ImageSize -> 200, BaseStyle -> {FontSize -> 12}];
Export["plotWithLegend.pdf", plotWithLegend]
the font size of the frame label is about 8 pt. This can be seen by importing the PDFs in a LaTeX document or by verifying the font size with Acrobat Pro.
Is this a bug? Is there a workaround for this behavior?
Row
(i.e. a formatted notebook expression) $\endgroup$