omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular
    1. Home
    2. Johanwikdahl
    3. Posts

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 1
    • Best 0
    • Controversial 0
    • Groups 0

    Posts made by Johanwikdahl

    • To_html5video
      def animate(step, p, U):
          p_r = np.sqrt(p[0, :]**2 + p[1, :]**2)
          u_p = U + (K / (2*np.pi)) * p[0, :] / p_r**2
          v_p = (K / (2*np.pi)) * p[1, :] / p_r**2
          U = np.asarray([u_p, v_p])
      
          # To avoid very large velocities for particles close to the center
          U[:, p_r < r_threshold] = 0.0
      
          # Update positions based on linear advection
      
          p += U * delta_t
          points.set_data(p[0, :], p[1, :])
      
      anim = animation.FuncAnimation(fig2, animate, frames=num_timesteps,interval=10000/FPS, fargs=(p, U))
      plt.close(anim._fig)
      
      HTML(anim.to_html5_video())
      #HTML(anim.to_jshtml())
      

      How can I make this animation run in Pythonista?

      posted in Pythonista
      Johanwikdahl
      Johanwikdahl