1
$\begingroup$

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, 
Thickness[0.004]}}, PlotRangePadding -> 0, 
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@
TraditionalForm[
 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!

enter image description here

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

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, 
    Thickness[0.004]}}, PlotRangePadding -> 0, 
 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@
     TraditionalForm[
      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.

$\endgroup$
0
$\begingroup$

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]))
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.