1
$\begingroup$

The input

Plot[1-(1-x)^Floor[2/x],{x,0,1/20}]

yields

plot with artifact

where the white space we see below the curve near $x=0.01$ is an artifact. How can we fix this simply? WorkingPrecision -> 999 does not help, the issue is the way $x$ is sampled.

$\endgroup$
3
  • 2
    $\begingroup$ Try the option PlotPoints -> 10^4. $\endgroup$ – Roman Jun 19 at 6:18
  • $\begingroup$ @Roman: if you don't make this an answer, I will! $\endgroup$ – fgrieu Jun 19 at 6:23
  • $\begingroup$ Please make it an answer. $\endgroup$ – Roman Jun 19 at 6:28
3
$\begingroup$

Roman gave the solution:

Plot[1-(1-x)^Floor[2/x],{x,0,1/20}, PlotPoints -> 10^4]

yields no artifact

$\endgroup$
1
  • 1
    $\begingroup$ As a general rule it is more efficient to increase both MaxRecursion and PlotPoints rather than depend solely on PlotPoints $\endgroup$ – Bob Hanlon Jun 19 at 15:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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