I am playing with the function legendMaker coming from the answer of this question. I am using same data form answer.

opts = Sequence[Background -> LightOrange, RoundingRadius -> 10];
data = {{1, 2}, {3, 4}, {5, 4}};
points = Table[{#1, Log[b, #2]} & @@@ data, {b, 2, 10, 2}];
plot = ListLinePlot[points];
labels = Table[Row[{Subscript["Log", b], x}], {b, 2, 10, 2}]
newPlot = Overlay[{plot, legendMaker[labels, opts]}, Alignment -> {Right,    Top}]

Please note that the function legendMaker is defined in the mentioned answer and not copied in my question.

The problem is that when I try to Export the newPlot in pdf format using command

Export[FileNameJoin[{Directory[], "newPlot.pdf"}], newPlot, 
ImageSize -> 1200, "CompressionLevel" -> 0]

I get too much white space on left side of the plot. Other formats such as png are working fine, but the quality is worse.

Probably this is because of the legend that is used. Same problem is described here. Methods (Rasterize and Inset) mentioned in the that post are not working in my case. Could somebody please help me how to get rid off white space on the left size of the plot and at the same time to have plot in pdf format?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.