# ImageSize not working correctly with Legends and Placed directives

It seems that having Placed inside Plot breaks the ImageSize specification:

cm = 72/2.54;
plt =
LogLogPlot[Exp[x], {x, 1, 3},
ImageSize -> 12 cm,
AspectRatio -> 0.73,
Frame -> True,
PlotLegends ->
Placed[
LineLegend[{"test"},
LegendMarkers -> Automatic, LegendFunction -> Framed, LegendMargins -> 5],
{Right, Top}]];
Export["test.eps", plt]


Once I remove the Placed directive, it works better. That may be because, without Placed, the ImageSize includes the legend (however this includes a relatively huge space between the end of the legend and what mathematica thinks to be the end of the plot, see picture below), but once I place the legend somewhere else, the same size is retained rather than determined again. Is there any way to work around this so that the example above is really 12 cm in size?

To illustrate, this is the eps produced by the code. The crosshair shows where 12 cm is in reality:

When I omit the Legend completely, I get size as wanted:

and when I use Legend without placed:

• worked for me (MMA10.4, Linux) – Sumit May 8 '16 at 7:20
• Could you expand on what "works" or doesn't work? Exporting works in both cases as far as producing a file, so what exactly doesn't work for you? – MarcoB May 10 '16 at 16:12
• @MarcoB I added some pictures that show the problem. The problem is in the size of the resulting plot. Without a legend, the size of the plot is ok, with legend, there is unwanted space between the legend to the right and the 12 cm margin. And when Placed is used to move the legend inside the plot, the margin between the end of the plot and the 12 cm rises as Mathematica does not recalculate some margins probably. – leosenko May 10 '16 at 19:59