Axes Labeling Latex like
Click on the picture and from the menu bar select Graphics-->drawing tools. A box will open by clicking on $\sum$, we can write mathematical text, one can explore more options.
Another approach is to do everything programmatically.
Add the arrows, line and text to Epilog
. I also made a small adjustment to the padding so the text would print below the figure.
Note that although the right hand side of the x-axis is labeled π, it is in reality the number 3. You might want to adjust the input b
value to match the axis label.
Plot[f[x], {x, a, b},
Epilog ->
{
EdgeForm[Black],
FaceForm[None],
rects,
Arrow[{{a + 3 h, 2*f[a + 3 h]/5}, {a + 3.4 h, 2*f[a + 3 h]/5}}],
Arrow[{{a + 4 h, 2*f[a + 3 h]/5}, {a + 3.6 h, 2*f[a + 3 h]/5}}],
Text[Style["\!\(\*FractionBox[\(2 π\), \(T\)]\)",
14], {a + 3.5 h, 2 f[a + 3 h]/7}],
Text[Style["0", 14], {0, -0.05}],
Text[Style["π", 14], {3, -0.05}],
Text[Style["\!\(\*SubscriptBox[\(ϕ\), \(8\)]\)",
14], {a + 7.5 h, -0.05}],
Text[Style["I[\!\(\*SubscriptBox[\(ϕ\), \(8\)]\)]",
14], {a + 7.5 h, f[a + 7.5 h] + 0.1}],
Red,
Line[{{a + 7.5 h, 0}, {a + 7.5 h, f[a + 7.5 h]}}]
},
ImageSize -> 500,
Axes -> False,
Frame -> {{True, False}, {False, True}},
FrameLabel -> {{"I[ϕ]", None}, {None, None}},
BaseStyle -> {FontSize -> 18},
FrameTicks -> None,
PlotRangePadding -> {{Scaled[0.03], Scaled[0.03]}, {Scaled[0.07],
Scaled[0.03]}}
]
]
plotAreaApprox[(2 #)/(1 + #^2) &, 0, 3, 10]
You may use DiscretePlot
to do most of the drawing for you with some help from FindDivisions
for the Ticks
. Then with Show
most of the effort can be placed in Epilog
with some help from Inset
.
plotAreaApprox[f_, a_, b_, n_] :=
Show[
Plot[f[x], {x, a, b},
Ticks -> {FindDivisions[{a, b, π}, 6], None}],
DiscretePlot[f[x], {x, a, b, (b - a)/n},
ExtentSize -> Center, PlotMarkers -> Point,
PlotStyle -> {Gray, EdgeForm[{Thin, Gray}]}, FillingStyle -> White],
ImageSize -> Large,
PlotRangePadding -> {{Scaled[.05], Scaled[.05]}, {Scaled[.15], Scaled[.1]}},
Epilog -> {
Inset[Row[{Style["I", Bold], "(\!\(\*SubscriptBox[\(ϕ\), \(7\)]\))"},
FrameMargins -> Large, Frame -> True, FrameStyle -> None,
BaseStyle -> {FontSize -> Scaled[.025]}],
With[{p = a + 7 (b - a)/n}, {p, f[p]}], {Center, Bottom}],
Inset[Style["\!\(\*SubscriptBox[\(ϕ\), \(7\)]\)",
FontSize -> Scaled[.025]], {a + 7 (b - a)/n, -.065}, {Center, Top}],
Arrowheads[{-.02, .02}],
Arrow[{{a + 1/2 (b - a)/n, -0.05}, {a + 3/2 (b - a)/n, -0.05}}],
Inset[Style[(b - a)/n, Bold], {a + (b - a)/n, -.065}, {Center, Top}]}
]
Then
plotAreaApprox[(2 #/(1 + #^2)) &, 0, π, 10]
And with Manipulate
altering the fineness of the approximation
Manipulate[
plotAreaApprox[(2 #/(1 + #^2)) &, 0, 2 π, n],
{{n, 7}, 7, 20, 1}]
Hope this helps.