# How to properly, with the most possible freedom, add a formula into a plot?

I would like to know the best way(s) to add a formula into a plot, with the most possible freedom ever. And I mean: possibility of writing the formula the dimension of which can be modified, put into whatever part of the plot I want, written in any possible colour and so on.

I know I'm pretty demanding.. This is what I was able to do so far:

Plot[d[10, 1, 1, 2, t, 0], {t, 0, 20}, PlotRange -> {0, 5},
LabelStyle -> {FontSize -> 22, FontFamily -> "Times", Black, Bold},
PlotStyle -> {{Darker[Blue], DotDashed, Thickness[0.004]}, {Red,
LabelStyle -> {FontSize -> 13}, AxesStyle -> Bold, Frame -> True,
FrameLabel -> {t [sec], \[ScriptCapitalD][t]},
LabelStyle -> {FontSize -> 13}, AxesStyle -> Bold,
FrameStyle -> {{Directive[FontColor -> Darker[Red]],
Automatic}, {Directive[FontColor -> Darker[Red]], Automatic}},
Epilog ->
Inset[HoldForm@
Subscript[\[ScriptCapitalD],
0] \[Theta][
t - Subscript[t, 0]]/(1 +
Log[1 + \[Alpha] t] (c + Sin[\[Beta] t])), {0.3, 0.9}]]]


The last part doesn't work, indeed the formula is always at the center of the plot, small written..

Any help?

Thank you so much!

• Please do not add unrelated tags. What is the relationship to LaTeX? If none, remove the tag. – Szabolcs Jun 22 '18 at 10:46

What about adding Style between Inset and HoldForm for the text style, and adding Scaled before closing the Inset parenthesis for the position in the plot:

Plot[d[10, 1, 1, 2, t, 0], {t, 0, 20}, PlotRange -> {0, 5},
LabelStyle -> {FontSize -> 22, FontFamily -> "Times", Black, Bold},
PlotStyle -> {{Darker[Blue], DotDashed, Thickness[0.004]}, {Red,
LabelStyle -> {FontSize -> 13}, AxesStyle -> Bold, Frame -> True,
FrameLabel -> {t[sec], \[ScriptCapitalD][t]},
LabelStyle -> {FontSize -> 13}, AxesStyle -> Bold,
FrameStyle -> {{Directive[FontColor -> Darker[Red]],
Automatic}, {Directive[FontColor -> Darker[Red]], Automatic}},
Epilog ->
Inset[
Style[
HoldForm@
Subscript[\[ScriptCapitalD],
0] \[Theta][
t - Subscript[t, 0]]/(1 +
Log[1 + \[Alpha] t] (c + Sin[\[Beta] t])), {0.3,0.9}],
{Red, 20}],
Scaled[{0.4, 0.2}]
]
]


In my example the formula is Red, dimension 20px, and placed at the bottom-left of the plot.

I found a way, which doesn't really answer to the question but it holds a bit. Write it as a PlotLabel question:

PlotLabel->Subscript[\[ScriptCapitalD],
0] \[Theta][
t - Subscript[t, 0]]/(1 + Log[1 + \[Alpha] t] (c + Sin[\[Beta] t]))