python - Graph for a polar equation is incomplete in matplotlib -


I am currently trying to graph the equation r = 4 * sin (2 * theta) < Based on the closed / / code> clamped shutter, this is my code in polar plane:

  Import import as NP import matplotlib.pyplot as math import from PLT , PE DIF Plot_Poller (F, start = 0, end = 2 * PI): THETA = NP. Linspace (start, end, 1000) r = map (f, theta) ax = plt.subplot (111, polar = true) ax.plot (theta, r) ​​ax.grid (True) plt.show () plot_polar (lambda Theta: 4 * sin (2 * theta))   

The result is in the following output:

 wrong

However, according to Wolfam Alpha, it looks like:

 right

The good part of my code graph is missing - it has only two fans instead of four. Am sure because theta is the 2pi from 0, so they should show the same object.

Does anyone know what I'm doing is wrong? I'm not sure if I'm just mistaking how to use matlotib, or if I'm missing some obvious error.

It seems that matplotib is knocking because you are giving it negative as a radius.

I tried your code and got the same results. I changed my line

  r = map (f, theta)   

be

  r = map  alt = "radial plot">  

If you ask me, "Polar conspiracy" from Wolfham is going to be a little misleading. It is definitely not structured like the Matlaplib version.

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -