# Could PlotLegends-\>Placed\[\] inconsistency be fixed?

**URL:** <https://community.wolfram.com/t/could-plotlegends-placed-inconsistency-be-fixed/25622>\
**Category:** Questions\
**Tags:** graphics-and-visualization\
**Created:** [July 2, 2025, 11:52am UTC](https://community.wolfram.com/t/could-plotlegends-placed-inconsistency-be-fixed/25622 "2025-07-02T11:52:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![antonlutsenko](https://avatars.discourse-cdn.com/v4/letter/a/b782af/32.png) [@antonlutsenko](https://community.wolfram.com/u/antonlutsenko)\
**Post date:** [July 2, 2025, 11:52am UTC](https://community.wolfram.com/t/could-plotlegends-placed-inconsistency-be-fixed/25622/1 "2025-07-02T11:52:31Z")

</div>

The documentation for PlotLegends specifies that the position of the legend can be manually controlled using Placed:

> PlotLegends-\>Placed[leg,pos] places the legend leg at the position specified by pos.  
> _pos_ in a form of _{{ex,ey},{lx,ly}}_: scaled position _{lx,ly}_ in the legend at scaled position _{ex,ey}_ in _expr_.

However, the behaviour seems to have a discrepancy for _ex_ or _ey_ being below 1 or more or equal to 1. Consider the following example:

```
Plot[{Sin[x], Cos[x]}, {x, 0, 2 \[Pi]},
 Frame -> True,
 FrameLabel -> {{"y", "y"}, {"x", "Trigonometric functions"}},
 ImageSize -> 400,
 PlotLegends -> 
  Placed[LineLegend["Expressions", 
    LegendFunction -> (Framed[#1, FrameMargins -> 0] & )],
   {{1 - 0.0001, 1 - 0.0001}, {1, 1}}]]

```

This results in legend being inside the Plot’s frame, and almost-but-not-quite aligned with it:

 ![plot0.999.jpg](https://global.discourse-cdn.com/wolfram/original/2X/5/55d6e67b140ce51b8ae66be096b7fc05975fe361.jpeg)

However, if one wants to actually align the legend to the corner frame, this happens:

```
Plot[{Sin[x], Cos[x]}, {x, 0, 2 \[Pi]},
 Frame -> True,
 FrameLabel -> {{"y", "y"}, {"x", "Trigonometric functions"}},
 ImageSize -> 400,
 PlotLegends -> 
  Placed[LineLegend["Expressions", 
    LegendFunction -> (Framed[#1, FrameMargins -> 0] & )],
   {{1, 1}, {1, 1}}]]

```

The legend ends up aligning to the corner of the expression’s frame (while also making the plot itself smaller)!

 ![plot1.jpg](https://global.discourse-cdn.com/wolfram/original/3X/c/1/c1f89e2b46995b5cf40dd28118d4d724fb4401bb.jpeg)

Is it possible to make this behaviour consistent? It would be amazing to be able to align to the Plot’s frame rather than to the Expression’s frame by default for both cases, even better to have it as an option, but even a simpler fix (everything always aligns to the Expression’s frame) would be great

---

<div class="post-metadata">

**Author:** ![sghuisman](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/sghuisman/32/27850_2.png) [@sghuisman](https://community.wolfram.com/u/sghuisman)\
**Post date:** [July 2, 2025, 1:16pm UTC](https://community.wolfram.com/t/could-plotlegends-placed-inconsistency-be-fixed/25622/2 "2025-07-02T13:16:14Z")

</div>

i think the problem is that Frame is not a Graphics objects. The coordinate issue (which is a bug I guess) can be solved by doing:

```
Placed[… , {Scaled[{1, 1}], Scaled[{1, 1}]}]

```

And not-so-nice solution would be to add the ‘box’ manually:

```
Plot[{Sin[x], Cos[x]}, {x, 0, 2 \[Pi]}, Frame -> True, 
 FrameLabel -> {{"y", "y"}, {"x", "Trigonometric functions"}}, 
 ImageSize -> 400, PlotRange -> {{0, 2 Pi}, {-1.1, 1.2}}, 
 PlotRangePadding -> None, 
 PlotLegends -> 
  Placed[LineLegend["Expressions"], {Scaled[{1, 1}], Scaled[{1, 1}]}],
  Epilog -> {EdgeForm[Black], FaceForm[], 
   Line[{{5, 1.2}, {5, 0.65}, {2 Pi, 0.65}}]}, FrameStyle -> Black]

```
