Skip to content

Vector field quiver plot for sequence #9

Answered by rfezzani
HamidGadirov asked this question in Q&A
Discussion options

You must be logged in to vote

Again, the solution is in matplotlib.pyplot.quiver arguments 😉 : you need to set the scale argument to a value different then None

import numpy as np
import pyimof
from matplotlib import pyplot as plt

plt.ion()


u = np.random.rand(460, 640)
v = np.random.rand(460, 640)
c = np.sqrt(u * u + v * v)

scale = 1

alpha = 1.2

ax = pyimof.display.quiver(u, v, c, clim=(0, 5), scale=scale)
for _ in range(50):
    ax.clear()
    u *= alpha
    v *= alpha
    c *= alpha
    pyimof.display.quiver(u, v, c, ax=ax, clim=(0, 5), scale=scale)
    input("Press any key")

I hope it solves your problem.

Replies: 6 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by rfezzani
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants
Converted from issue

This discussion was converted from issue #5 on February 13, 2023 13:20.