Skip to main content
19-Tanzanite
July 15, 2023
Solved

Strange Graph Display

  • July 15, 2023
  • 2 replies
  • 1093 views

Hello,

I plotted this function and the graph looks something "strange", at least at first glance. Normally it should have shown a continuous line, or?

Cornel_0-1689419825218.png

Cornel_0-1689420065531.png

Cornel_1-1689419836364.png
MC8 Prime.

Best answer by Werner_E

You function f() returns non-real numbers with a tiny imaginary part for a lot of input values. Maybe due to numerical inaccuracies/round offs. Primes plot refuses to plot anything in this case, hence the empty spots.

Werner_E_0-1689425469608.png

 

ttokoro showed that using just the real part of the result for plotting might be a solution to the problem.

You may also consider using the Re() function already in the definition of f().

 

2 replies

ttokoro
21-Topaz I
21-Topaz I
July 15, 2023

image.png

t.t.
Werner_E25-Diamond IAnswer
25-Diamond I
July 15, 2023

You function f() returns non-real numbers with a tiny imaginary part for a lot of input values. Maybe due to numerical inaccuracies/round offs. Primes plot refuses to plot anything in this case, hence the empty spots.

Werner_E_0-1689425469608.png

 

ttokoro showed that using just the real part of the result for plotting might be a solution to the problem.

You may also consider using the Re() function already in the definition of f().