I have two arrays (vel_y,vel_z) representing velocities in the y and z directions, respectively, that are both shaped as (512,512) that I am attempting to represent using a quiver plot. Here is how I plotted the quiver:
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(0,512,num=512)
[X,Y] = np.meshgrid(x,x)
fig, ax = plt.subplots(figsize=(7,7))
ax.quiver(X,Y,vel_y,vel_z,np.arctan2(vel_z,vel_y),pivot='mid',units='x',scale=2)
The arctan2() call is so that different orientations are colored differently as in this answer. Obviously plotting all 5122 of these arrows makes for a jumbled and difficult to parse plot, which you can see here: Quiver Plot.
I was wondering if there was a better way to scale/represent the arrows so that it is more readable?
However, the main question I have is how I could 'downsample' this velocity information to go from plotting 5122 arrows to 1002 for example. Would this require interpolation between points where the velocity is defined?
Thank you!