1
$\begingroup$

I am just trying to plot a very simple function:

Plot3D[Abs[(2 Sqrt[n (1 + n)]Cos[4 Pi q])/((1 + 2 n) (-1 - 2 n - 2 n^2 + 2 n (1 + n) Cos[2 (4 Pi q)]))] - (2 n (1 + n) Sin[4 Pi q]^2)/(-1 - 2 n - 2 n^2 + 2 n (1 + n) Cos[2 (4 Pi q)]), {q, 0, 3}, {n, 0, 3}, PlotRange -> {0, 1}]

and I get a weird plot:(BTW, I cannot save this plot, it says "The specified setting for the option WindowSize cannot be used.")

enter image description here

Now I just change the range of q from 0~3 to 0~1:

Plot3D[Abs[(2 Sqrt[n (1 + n)]Cos[4 Pi q])/((1 + 2 n) (-1 - 2 n - 2 n^2 + 2 n (1 + n) Cos[2 (4 Pi q)]))] - (2 n (1 + n) Sin[4 Pi q]^2)/(-1 - 2 n - 2 n^2 + 2 n (1 + n) Cos[2 (4 Pi q)]), {q, 0, 1}, {n, 0, 3}, PlotRange -> {0, 1}]

Now I get a reasonable result: enter image description here Can anyone tell me what is going on here? Thanks!

$\endgroup$
1
  • 4
    $\begingroup$ What do you think is "weird" about it? You can use PlotPoints->100 to get better resolution, but until we know what "weird" means, we can't help you. $\endgroup$ Mar 3 '17 at 19:03
3
$\begingroup$

PlotPoints -> 100 fixes everything.

$\endgroup$
1
  • $\begingroup$ That's what I need, thank you! $\endgroup$
    – Jieyu You
    Mar 3 '17 at 21:17

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