In this example, how can I put the legend inside the graph? Currently, when I save the graph, only the graph is saved, not the legend.
Expr1 = -2 p + 1
Expr2 = 2 p - 1
Expr3 = p - 1/2
Plot[{Expr1, Expr2, Expr3}, {p, 0, 1},
BaseStyle -> AbsoluteThickness[4],
PlotLegends ->
LineLegend["Expressions", BaseStyle -> AbsoluteThickness[4]]]
Solve[Expr1 == Expr2, p]
Also, how can I insert the solution in the last line, also inside the graph?
Here you can see the result:
Answer
This is how to save the graph, legend and all:
Another way would be to use Rasterize
:
Rasterize[Plot[...]]
The legend and the graph is now one image.
Comments
Post a Comment