I want to make some description on my plots, but I can't make it good.
First I tried this:
Plot[Sin[100 x], {x, 0, 50}, PlotStyle -> Black,
Epilog ->
Inset[Framed[Style[111, 30, Red], FrameStyle -> Red,
Background -> Directive[White, Opacity[0.5]]], {25, 0}, {Center,
Bottom}], AxesStyle -> Red]
But I need some margins, so I did it:
Plot[Sin[100 x], {x, 0, 50}, PlotStyle -> Black,
Epilog ->
Inset[Framed[Style[111, 30, Red], FrameStyle -> Red,
Background -> Directive[White, Opacity[0.5]],
ImageMargins -> 5], {25, 0}, {Center, Bottom}], AxesStyle -> Red]
But where is my background??? I don't understand what's wrong. OK. I tried this:
Plot[Sin[100 x], {x, 0, 50}, PlotStyle -> Black,
Epilog ->
Inset[Framed[Style[111, 30, Red], FrameStyle -> Red,
ImageMargins -> 5], {25, 0}, {Center, Bottom},
Background -> Directive[White, Opacity[0.5]]], AxesStyle -> Red]
Ands it's not that I want. I need margins without background. So I make a stupid thing, I added one Framed more:
Plot[Sin[100 x], {x, 0, 50}, PlotStyle -> Black,
Epilog ->
Inset[Framed[
Framed[Style[111, 30, Red], FrameStyle -> Red,
Background -> Directive[White, Opacity[0.5]]],
FrameStyle -> None, ImageMargins -> 5], {25, 0}, {Center,
Bottom}], AxesStyle -> Red]
OK. That's not so bad. But why margins are so big?
Plot[Sin[100 x], {x, 0, 50}, PlotStyle -> Black,
Epilog ->
Inset[Framed[
Framed[Style[111, 30, Red], FrameStyle -> Red,
Background -> Directive[White, Opacity[0.5]]],
FrameStyle -> Green, ImageMargins -> 5], {25, 0}, {Center,
Bottom}], AxesStyle -> Red]
Oh... That's because we have some padding inside of our frame. And how can I zero this padding?
So what can I do to make what I want? I can't understand why second example didn't work. But I want to see the picture as if it worked.
Sorry if i'm so newbie in WM. Thx.
Plot[Sin[100 x], {x, 0, 50}, PlotStyle -> Black, Epilog -> Inset[ Framed[Style[111, 30, Red], FrameStyle -> Red, Background -> Directive[White, Opacity[0.5]]], {25, 0}, {Center, -1.2}], AxesStyle -> Red]
$\endgroup$Plot[Sin[100 x], {x, 0, 50}, PlotStyle -> Black, Epilog -> Inset[ Framed[Style[111, 30, Red], FrameStyle -> Red, Background -> Directive[White, Opacity[0.5]]], Offset[{0, 5}, {25, 0}], {Center, Bottom}], AxesStyle -> Red]
-- this keeps the Framed expression offset from zero by a fixed absolute distance. $\endgroup$