Я строю дипольное поле, которое имеет особенность в начале координат.Поэтому я хочу раскрасить стрелки, чтобы обозначить силу поля.
Сейчас мне удается создать нужные стрелки, но цвет идет вдоль тета-оси, а не вдоль оси r:
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
import matplotlib.cm as cm
from matplotlib.colors import Normalize
fig = plt.figure(figsize=(15,10))
ax = fig.gca(projection='polar')
n=30
m=8
thetas = np.linspace(0, 2*np.pi, n)
radii = np.linspace(0.15, 1, m)
theta, r = np.meshgrid(thetas, radii)
p = .3
Er = p*2*np.cos(theta)#/r**3
Et = p*np.sin(theta)#/r**3
m = np.meshgrid(thetas,radii)
#This is where one should define m such that it results in the color coding I want. Unfortunately, I am not completely sure how the color is decoded in the quiver function.
ax.set_title("Dipole field", va='bottom')
ax.quiver(theta, r, Er * np.cos(theta) - Et * np.sin (theta), Er * np.sin(theta) + Et * np.cos(theta), m, pivot='mid')
plt.show()

Хотелось бы, чтобы стрелки были темнее рядом с началом координат и ярче с расстоянием r = sqrt (x ^ 2 + y ^ 2) от происхождения растет.