# I need to remove a line from a ParametricPlot

What happens is that when I make this ParametricPlot:

ClearAll [f, g]

f2 [t_]:= t + 1 / t
g2 [t_]:= t - 1 / t
ParametricPlot [{f2 [t], g2 [t]}, {t, 0.00001, 20},
PlotRange -> {{0, 5}, {-4, 1}}, ImageSize -> 200]
ParametricPlot [{f2 [t], g2 [t]}, {t, -80, 80},
PlotRange -> {{-4, 4}, {-2, 4}}, ImageSize -> 200]


The graph of the parametric function appears and additionally appears a straight line through the origin. How I can remove it?

-
The line is caused by a discontinuity in your functions at t == 0. See these articles in the Wolfram Language Documentation Center: Exclusions and ExclusionsStyle . – m_goldberg Aug 31 '14 at 12:55
you may find this answer useful How do I exclude the vertical line plotted at a discontinuity? – Sumit Aug 31 '14 at 13:18

ParametricPlot[{f2[t], g2[t]},
{t, -80, 80},
PlotRange -> {{-4, 4}, {-2, 4}},
Exclusions -> {f2[t] == 0},
ImageSize -> 400]


Because

FunctionDomain[f2[t], t]


Another possibility:

ParametricPlot[{f2[t], g2[t]},
{t, -80, 80},
PlotRange -> {{-4, 4}, {-2, 4}},
Exclusions -> {f2[t] == 0},
ExclusionsStyle -> Directive[Red, Dashed],
ImageSize -> 400]


Update

Based upon Karsten's comment and Michael's review a complete solution set could look like this:

pg = Point[Transpose[{Re@#, Im@#}]] &[t /. Solve[g2[t] == 0, t]]


Point[{{-1, 0}, {1, 0}}]

pf = Point[Transpose[{Re@#, Im@#}]] &[t /. Solve[f2[t] == 0, t]]


Point[{{0, -1}, {0, 1}}]

par =
ParametricPlot[{f2[t], g2[t]},
{t, -80, 80},
PlotRange -> {{-4, 4}, {-2, 4}},
Exclusions -> t == 0,
Epilog -> {PointSize[0.02], {Blue, pf}, {Red, pg}},
PlotStyle -> Green,
ImageSize -> 400];

leg =
SwatchLegend[{Green, Blue, Red}, {"{f2[t], g2[t]} != 0", "f2[t] == 0", "g2[t] == 0"}];

Legended[par, leg]


-
Or Exclusions -> t == 0 – Karsten 7. Aug 30 '14 at 13:22
(+1) very nice answer. – Algohi Aug 30 '14 at 16:47
The only solutions to f2[t] == 0 are ± I. Why would that exclude t == 0, which needs to be excluded according to FunctionDomain? – Michael E2 Aug 31 '14 at 13:54
@MichaelE2 (a) FunctionDomain[f2[t], t, Complexes] gives t != 0. (b) Solve[f2[t] == 0, t] gives, as you wisely remarked, {{t -> -I}, {t -> I}}. – eldo Aug 31 '14 at 14:10
You seem to agree that the Exclusions condition in your answer does not correspond to the FunctionDomain condition. It seems to me that the Exclusions setting is wrong and the FunctionDomain is correct. Is it an accident that Exclusions -> {f2[t] == 0} works on the ParametricPlot, or is there some explanation that I'm not seeing? – Michael E2 Aug 31 '14 at 14:27

This is not really any advance on eldo's answer. I post it for illustration:

Manipulate[
ParametricPlot[{t + 1/t, t - 1/t}, {t, -10, 10}, Exclusions -> {0},
Epilog -> {Red, PointSize[0.02],
Point[{p + 1/p, p - 1/p}]}], {p, -10, 10}]


-
Nice jump ! Amazing how the point accelerates on the long diagonals :) – eldo Aug 31 '14 at 12:25
@eldo must admit...jump major reason i posted :) – ubpdqn Aug 31 '14 at 12:29
Exclusions -> {0} seems a quite clear way to address the OP's problem. – Michael E2 Aug 31 '14 at 13:45
r = ParametricRegion[{t + 1/t , t - 1/t }, {{t, -80, 80}}];
RegionPlot[r, PlotRange -> {{-4, 4}, {-2, 4}}, Frame -> False,
Axes -> True]


-
As unusual as interesting :) – eldo Aug 30 '14 at 17:48