4
$\begingroup$

Edit: Syed's and Lukas's suggestions both solve this problem, thank you very much.

I'm having some issues with a set of plots I'm making (it's to do with Penrose diagrams, but that's probably not of importance). Specifically, I input

transformation = {Tan[X + T] == x + t, Tan[X - T] == x - t};
solveforXT = Solve[transformation, {X, T}, Reals][[2]] /. {C[1] -> 0, C[2] -> 0};
XTvec = {X, T} /. solveforXT

which outputs

Out[*]= {1/2 (-ArcTan[t - x] + ArcTan[t + x]),1/2 (ArcTan[t - x] + ArcTan[t + x])}

Then, I use ParametricPlot to draw some graphs. First, I plot

ParametricPlot[{XTvec /. {t -> -inf},  XTvec /. {t -> inf}}, {x, -Inf, Inf},  PlotRange -> {{-\[Pi]/2, \[Pi]/2}, {-\[Pi]/2, \[Pi]/2}},  PlotStyle -> {Black}]

where inf and Inf are just numbers, 10^2 and 10^3 respectively, which make the plot look the way I want it. Indeed, this outputs a figure,
The plot, the way I want it.

which is exactly the figure I want to end up with, but if I do all my plots in this manner, it will get unreadable fast. So I define a function,

Curve[t0_, x0_] := XTvec /. {t -> t0, x -> x0}

which, in my head, will do the exact same thing as the above. So then I write the exact same command as before, but with the Curve function in it,

ParametricPlot[{Curve[-inf, x], Curve[inf, x]}, {x, -Inf, Inf},  PlotRange -> {{-\[Pi]/2, \[Pi]/2}, {-\[Pi]/2, \[Pi]/2}},  PlotStyle -> {Black}]

The figure drawn with a function, which suddenly has holes in it.

But suddenly, the graph is no longer complete. It has big holes in it. Nothing I do seems to change this; I can reduce the size of Inf compared to inf which will reduce the size of the holes somewhat, but nothing I do gets rid of the holes completely. What is causing this?

If it matters: I'm using Mathematica 13.2.

$\endgroup$
4
  • 3
    $\begingroup$ Adding Exclusions -> None would fix it. $\endgroup$
    – Syed
    Mar 24, 2023 at 9:37
  • 2
    $\begingroup$ Not sure yet why it's different, but MaxRecursion -> 15 fixes it $\endgroup$
    – Lukas Lang
    Mar 24, 2023 at 9:45
  • 2
    $\begingroup$ It has to do with resolution. Your curve has has a large region where the derivative is nearly zero and a small region where the derivative is hugh. Now it depends on how the curve is sampled. If it is sampled at evenly distributed point, the chance is high that the small region is missed. Therefore, ParametricPlot seems to use different method for sampling in both cases. $\endgroup$ Mar 24, 2023 at 9:54
  • $\begingroup$ Thank you all! Both Lukas's and Syed's suggestions work, and I very much appreciate Daniel's explanation on why it doesn't work. $\endgroup$
    – David S
    Mar 24, 2023 at 14:41

0

Your Answer

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

Browse other questions tagged or ask your own question.