# Fill gap created by Exclusions

A gap appears at the locations of Exclusions at t=1,t=1+t0 when the top slider for t0 is set to Play. How can these gaps be avoided or filled in?

 Manipulate[

y[t_, t0_] := 1/(1 - (t - t0));
y0[x_] := y[x, 0];
yT[x_] := y[x, t0];

Plot[{y0[t], yT[t]}, {t, -3, 7},
Exclusions -> {t == 1, t == 1 + t0},
PlotStyle -> {{Thick, Black}},
PlotRange -> {0, 3},
Frame -> True,
Axes -> False,
ImageSize -> 1.2 {500, 330},
BaseStyle -> {FontSize -> 16},
FrameLabel -> {t, x},
RotateLabel -> False,
PlotRangePadding -> {{2, 0}, {.1, .1}},
Epilog -> {PointSize[0.015], Red, Dashed,
Line[{{-4, y0[s]}, {s, y0[s]}}],
Point[{{-4, y0[s]}, {s, y0[s]}, {s + t0, yT[s + t0]}}],
Black, Dashing[{}], Line[{{-4, 0}, {-4, 3}}],
Red, Point[{-4, y1[s]}],
Black, Arrowheads[.03], Arrow[{{-4, 3}, {-4, 3.1}}],
Red, Dashing[{}], Line[{{s, y0[s]}, {s + t0, yT[s + t0]}}]}],

{{t0, 2}, -2, 5, 0.01},
{{s, 0}, -2, 0.67, 0.01}

]

• You're plotting two different functions and each has a reasonable choice of Exclusions independent of the other. Why don't you use to Plot command and combine the results with Show? You might also try the TrackedSymbols -> {t0,s} in your Manipulate command. Finally, with 9 questions now asked, I think it would be reasonable for you to properly format your code - it's just a matter of indenting your code block four spaces. – Mark McClure Aug 10 '14 at 12:59
• Your epilog contains Point[{-4, y1[s]}], but y1 is not defined. – m_goldberg Aug 10 '14 at 13:53
• I used Mark's suggestion and made the changes suggested by m_goldberg. All worked well. BTW, the "y1" was a typo; it should have been "y0" – Stephen Aug 11 '14 at 19:51

I followed Mark McClure's suggestion concerning making two plots and combining them with Show, and it indeed fixes your gap problem.

Manipulate[
Show[
Plot[y0[t], {t, -3, 6.5},
PlotRange -> {0, 3},
PlotStyle -> {{Thick, Black}},
Exclusions -> {t == 1}],
Plot[yT[t], {t, -3, 6.5},
PlotRange -> {0, 3},
PlotStyle -> {{Thick, Black}},
Exclusions -> {t == 1 + t0}],
Frame -> True, Axes -> False,
ImageSize -> 1.2 {500, 330},
BaseStyle -> {FontSize -> 16},
FrameLabel -> {"t", "x"},
RotateLabel -> False,
PlotRangePadding -> {{2, 0}, {.1, .1}},
Epilog ->
{
{Red, PointSize[0.015],
Point[{{-4, y0[s]}, {s, y0[s]}, {s + t0, yT[s + t0]}, {-4, y1[s]}}]},
{Red, Line[{{s, y0[s]}, {s + t0, yT[s + t0]}}],
Dashed, Line[{{-4, y0[s]}, {s, y0[s]}}]}
}],
{{t0, 2.}, -2., 5., 0.01, ImageSize -> Large},
{{s, 0.}, -2., 0.67, 0.01, ImageSize -> Large},
Initialization :>
(
y[t_, t0_] := 1/(1 - (t - t0));
y0[x_] := y[x, 0];
y1[x_] := y[x, 1];
yT[x_] := y[x, t0]
)] While I was at it, I rewrote your epilog to make it more logical and concise, and I introduced an initialization option so that your local functions are only defined once (in your code they are redefined every time the content pane is refreshed). I also made a guess about y1.

• I feel strangely compelled to upvote this! – Mark McClure Aug 11 '14 at 0:45

Combinining consecutive Lines into a single Line and moving the function definitions to Initialization (as suggested by @m_goldberg)

Manipulate[MapAt[# /. {x__, lines : Line[_] ..} :> {x,Line[Join @@ ({lines}[[All, 1]])]} &,
Plot[{y0[t], yT[t]}, {t, -3, 7},
Exclusions ->
{t == 1, t == 0.5, t == 0.5 + t0, t == 1 + t0}, (* with few more exclusions *)
PlotStyle -> {{Thick, Black}}, PlotRange -> {0, 3}, Frame -> True,
Axes -> False, ImageSize -> 1.2 {500, 330},
BaseStyle -> {FontSize -> 16}, FrameLabel -> {t, x},
RotateLabel -> False, PlotRangePadding -> {{2, 0}, {.1, .1}},
Epilog -> {PointSize[0.015], Red, Dashed,
Line[{{-4, y0[s]}, {s, y0[s]}}],
Point[{{-4, y0[s]}, {s, y0[s]}, {s + t0, yT[s + t0]}}], Black,
Dashing[{}], Line[{{-4, 0}, {-4, 3}}], Red, Point[{-4, yT[s]}],
Black, Arrowheads[.03], Arrow[{{-4, 3}, {-4, 3.1}}], Red,
Dashing[{}], Line[{{s, y0[s]}, {s + t0, yT[s + t0]}}]}], {1}] ,
{{t0, 2}, -2, 5, 0.01}, {{s, 0}, -2, 0.67, 0.01},
Initialization :> (y[t_, t0_] := 1/(1 - (t - t0));
y0[x_] := y[x, 0];
yT[x_] := y[x, t0])]


Before (with Plot[...] instead of MapAt[..., Plot[...], ...]): After: • I do not understand the use of MapAt ... and the code that follows on the first line of your suggestion. – Stephen Aug 11 '14 at 19:56