Search code examples
plottextwolfram-mathematicamathematica-8

Plots with in-texts (with specificed positions) in Mathematica


I have a plot where I plot different equations in each chunk of the graph. Using text, I want to write a small notation for each piece of the equation. The Text function does not yield the result. Also is there a way to specify the coordinates of the text? For example, I want the text reading Eqn 1 (see below) to be placed at (0, 0.5)

Here is my code:

Pars = {ep -> 0.5, f1p -> 0.3, f2p -> 0.1, dp -> 0.05, q -> 0.1, 
   en -> 0.4, d -> 0.1, Q -> 0.1, f2n -> 0.3, f1n -> 0.4, a -> 0.05, 
   N1 -> 0.5, N2 -> 0.5}; #Parameters

PlotREq1 = 
  Plot[R = S /. Pars, {S, 0, 0.9375}, 
   PlotRange -> {{0, 3.5}, {0, 2}}, PlotStyle -> {Red, Thick, Dashed},Text[Eqn1]];  
PlotREq2 = 
  Plot[R = (a + d)/(en f1n) /. Pars, {S, 0.9375, 1.4375}, 
   PlotRange -> {{0, 3.5}, {0, 2}}, PlotStyle -> {Green, Thick, Dashed}, Text[Eqn2]];
PlotREq3 = 
  Plot[R = ((a + d) (f1p - f2p))/(en (f1p f2n - f1n f2p)) /. Pars, {S,
     1.4375, 2.3}, PlotRange -> {{0, 3.5}, {0, 2}}, 
   PlotStyle -> {Blue, Thick, Dashed}, Text[Eqn3]];
Show[PlotREq1, PlotREq2, PlotREq3]

Solution

  • Show[PlotREq1, PlotREq2, PlotREq3,
     Epilog -> {
       Inset[Framed[Style["Eqn 1", 14], Background -> White, FrameStyle -> None], {0.5, 0.5}], 
       Inset[Style["Eqn 2", 14], {1.18, 1.05}], 
       Inset[Style["Eqn 3", 14], {1.9, 1.6}]}]
    

    enter image description here