0

I'm trying to make some ParametricPlot and ParametricPlot3D of functions are singular but because Mathematica insists on drawing the asymptotic lines (i.e. connecting the infinities) it makes the pictures confusing. As an example take the function $\frac{1}{1-x}$, there is a vertical line at 1. Supposedly, the option Exclusions -> True should fix that, but that doesn't work for me.

Edit: For more concreteness, here is the mid-level difficulty thing I'm trying to plot:

R = 3;
X0 = {0, 0};
X = {t, x};
Cv = {0, -(1/(2 R))};
η = {{-1, 0}, {0, 1}};

Manipulate[Xhyp = {s, -Sqrt[α^2 + s^2]}; 
 Xsph = (Xhyp - Xhyp.η.Xhyp Cv)/(1 - 2 Xhyp.η.Cv + Xhyp.η.Xhyp Cv.η.Cv) + 2 R^2 Cv; 
 ParametricPlot[{Xsph[[2]], Xsph[[1]]}, {s, -r, r}, 
 PlotRange -> {{-3 R, 3 R}, {-3 R, 3 R}}, Exclusions -> True],
 {r, 0.1, 100}, {{α, 10}, 0.1, 10}]

As you can see for small enough alpha and big enough the r, after the hyperbola on the left, it comes back from the other side and Mathematica draws the asymptotic lines. Those are what I want to get rid of.

Michael E2
  • 235,386
  • 17
  • 334
  • 747
Löwe Simon
  • 141
  • 3
  • Exclusions -> {x = 1} – Feyre Aug 02 '16 at 21:18
  • @Feyre Yes, that would work for this simple example, but what I'm looking for is for Mathematica to do this on its own. The actual functions I want to plot are complicated, I don't know exactly where the singularities are. – Löwe Simon Aug 02 '16 at 21:20
  • Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! – Michael E2 Aug 02 '16 at 21:21
  • 1
    Exclusions -> {1/f[x] == 0}? If not, you might need to edit the question to include a typical example. – Michael E2 Aug 02 '16 at 21:23
  • Can't you make a function in the vein of Exclusions -> {x - 1 == 0} – Feyre Aug 02 '16 at 21:23
  • Maybe look at this question and set of answers. (Of course, these aren't for parametric plots, which makes it much more difficult, but it's perhaps a start.) – march Aug 02 '16 at 21:23
  • Like @MichaelE2 said, I was doing it and now see his comment. Clear[f, x] f = 1/((x - 1) (x - 4) (x - 5)); poles = Solve[1/f == 0, x]; poles = poles /. Rule -> Equal; Plot[f, {x, -5, 5}] Plot[f, {x, -5, 5}, Exclusions -> poles] Mathematica graphics – Nasser Aug 02 '16 at 21:31
  • 1
    @Nasser One advantage (maybe simultaneously, a weakness?) to Exclusions -> 1/f == 0 is that I believe Plot will break the graph whenever f changes sign, so that it doesn't have to be an equation that can be solved. (It still works on even-order poles, because they leave the plot range.) – Michael E2 Aug 02 '16 at 21:42
  • Exclusions -> {1/Xsph[[2]] == 0, 1/Xsph[[1]] == 0} works if you simplify Xsph first: Xsph = Simplify[..<your formula here.>..] (I think there's a common factor to be canceled.) – Michael E2 Aug 02 '16 at 21:50

0 Answers0