4
$\begingroup$

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?

$\endgroup$
2

3 Answers 3

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

enter image description here

Because

FunctionDomain[f2[t], t]

enter image description here

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]

enter image description here

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]

enter image description here

$\endgroup$
5
  • 4
    $\begingroup$ Or Exclusions -> t == 0 $\endgroup$
    – Karsten7
    Aug 30, 2014 at 13:22
  • $\begingroup$ (+1) very nice answer. $\endgroup$ Aug 30, 2014 at 16:47
  • $\begingroup$ The only solutions to f2[t] == 0 are ± I. Why would that exclude t == 0, which needs to be excluded according to FunctionDomain? $\endgroup$
    – Michael E2
    Aug 31, 2014 at 13:54
  • $\begingroup$ @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}}. $\endgroup$
    – eldo
    Aug 31, 2014 at 14:10
  • $\begingroup$ 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? $\endgroup$
    – Michael E2
    Aug 31, 2014 at 14:27
3
$\begingroup$

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}]

enter image description here

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

enter image description here

$\endgroup$
1
  • $\begingroup$ As unusual as interesting :) $\endgroup$
    – eldo
    Aug 30, 2014 at 17:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.