[Python] Python animation polar plot

Discussão em 'Python' iniciado por Stack, Junho 23, 2025.

  1. Stack

    Stack Membro Participativo

    I tried to create an animation with this plot, where with the increase of 'beta' the curves go stretching, but I could not. Please, can anyone help me?

    import numpy as np
    import matplotlib.pyplot as plt
    from matplotlib.animation import FuncAnimation

    # Data:
    mu = 1
    e = 1
    a = 1
    c = 1
    beta = np.linspace(0.0 ,0.5,25)
    C = (mu*((e*a)**2)) / (16*(np.pi**2)*c)

    theta = np.linspace(-2 * np.pi, 2 * np.pi, 200)

    fig = plt.figure(figsize=(6,6))
    ax = plt.subplot(111, polar=True)

    for i in range(len(beta)):
    b = beta
    r = ((np.sin(theta))**2) / ((1 - b*np.cos(theta))**5)
    dP = C*r
    ax.plot(theta, dP)
    ax.set_yticklabels([])
    if i==10000:
    break

    plt.show()

    Continue reading...

Compartilhe esta Página