# PlotLegends output graphics do not include legends when manually selected

I've noticed (in v11.0.1 and v10.3.1) a small problem with the graphic produced withPlot and the PlotLegends option: if you try to select manually the whole output graphic (mouse click) it won't include the legends ! It means you can't manually export the whole plot ("Save graphics as"), because you'll loose the legends ...

For example with this example taken from the docs:

Plot[{Sin[x], Sin[2 x], Sin[3 x]}, {x, 0, 2 Pi}, PlotLegends -> "Expressions"]


i get the following (orange) graphic frame if I click on the graphic curves (nothing happens if i click on the legends)

There is no way to include these legends.

If you look at this same example in the docs (notebook not web) and select the graphic, it will include the legends because all the graphics where rasterized and are not anymore "native" plots (as indicated previously to me by @Michael E2).

I tried then to reproduce the doc "rasterized" graphic which actually has the Image type. It is interesting to see that the command:

Plot[{Sin[x],Sin[2x],Sin[3x]}, {x,0,2Pi}, PlotLegends -> "Expressions"] // Image


produces an error (while other plots without PlotLegends won't):

The workaround here is to use Rasterize before Image (though Image should give directly the same result):

Plot[{Sin[x],Sin[2x],Sin[3x]}, {x,0,2Pi}, PlotLegends -> "Expressions"] //
Rasterize // Image


Once again, it is probably not a big problem as it concerns only the manual graphic export, but it looks clearly as a bug and there could be some other related (hidden) problems behind that ...

• Is there a question here? If not I'd recommend you just send the information to WRI. It's less likely to be addressed if just posted here. – ktm Oct 4 '16 at 14:20
• Another workaround: Evaluate Plot[{Sin[x], Sin[2 x], Sin[3 x]}, {x, 0, 2 Pi}, PlotLegends -> "Expressions"], copy the output cell's contents (not the cell itself, but highlight the graph + the legend), paste it into an empty text cell (alt+7), and then save this cell by right clicking on the cell bracket and select Save Selection As. A bit cumbersome, but it likely scales better than the rasterized image, and prevents saving the cell label (the original Out[#]) – ktm Oct 4 '16 at 14:25
• @user6014 Thanks, i knew the cell bracket workaround but this was not my point. See my comment to JasonB answer. – SquareOne Oct 4 '16 at 20:19

I think you can't select the plot plus legend and "Save Graphic as" because it is a Legended object rather than a Graphics object.
If you want to save it using a menu command rather than Export, you can select the cell bracket rather than the graphic itself, and select "Save Selection As" from the File menu,
• Good point: i completely missed the fact that the use of PlotLegends turned the plot Graphics object into a Legended object ! It explains why direct Image conversion does not work. BUT this is rather a very awkward feature ! It means that, potentially, any option can modify the default output type of a function !? Right know i don't recall any similar cases ... Do you ? Anyway, the problem concerns all the Legended objects ... I'll probably edit my post and title. – SquareOne Oct 4 '16 at 20:14