# Moving a plot label along with a moving threshold line

Here is a simple Manipulate expression with a threshold.

Manipulate[
Show[
Plot[
Piecewise[{{ξ x^2, x <= 1/(2 ξ - 1)}, {x, x > 1/(2 ξ - 1)}}], {x, 0, 5}],
Graphics[Line[{{1/(2 ξ - 1), 0}, {1/(2 ξ - 1), 25}}]]],
{ξ, 0, 1, Appearance -> "Labeled"}]


How to label the foot of the threshold line in such a way that it moves with it?

One way is to add a text element in the graphics object:

Manipulate[
Show[Plot[
Piecewise[{{ξ x^2, x <= 1/(2 ξ - 1)}, {x,
x > 1/(2 ξ - 1)}}], {x, 0, 5}],
Graphics[{Line[{{1/(2 ξ - 1), 0}, {1/(2 ξ - 1), 25}}],
Text["label", {1/(2 ξ - 1), 0}]}]], {ξ, 0, 1,
Appearance -> "Labeled"}] I differ from xslittlegrass on what you want the label to be. I would modify your code like so:

Manipulate[
With[{threshold = 1/(2 ξ - 1)},
Show[
Plot[
Piecewise[{{ξ x^2, x <= threshold}, {x, x > threshold}}], {x, 0, 5}],
Graphics[
{HalfLine[{threshold, 0}, {0, 1}],
Text[Round[threshold, .01], {threshold, -2.25}]}],
PlotRange -> {{0, 5}, {0, 16}},
PlotRangePadding -> {{Automatic, .1}, {3., Automatic}},
PlotRangeClipping -> False]],
{{ξ, .6}, 0.55, 1., Appearance -> "Labeled"}] This produces a moving label that gives the current value of threshold.

Manipulate[Plot[Piecewise[{{ξ x^2, x <= 1/(2 ξ - 1)}, {x, x > 1/(2 ξ - 1)}}], {x, 0, 5},
GridLines -> {{{1/(2 ξ - 1), Directive[Thick, Red]}}, {}},
Epilog -> Text[Framed[ToString@Round[1/(2 ξ - 1), .1],
Background -> Orange], {1/(2 ξ - 1), -.5}], 