Choosing two starting points in the same streamline in pyplot.streamplot lead to
an InvalidIndexError.
Minimal non-working example :
import numpy as np
import matplotlib.pyplot as plt
# Data
x = np.linspace(-10, 10, 10)
y = np.linspace(-10, 10, 10)
X, Y = np.meshgrid(x, y)
U = X*0 + 1
V = X*0
start_points = np.array([[0, 0], [5, 0]])
# streamline plot with aligned starting points
plt.figure()
sp = plt.streamplot(x, y, U, V, start_points=start_points,
color='r')
plt.show()
Maybe a better behaviour would be to skip the points responsible for the conflicts, i.e replacing in streamplot.py (in get_integrator(), integrate()):
dmap.start_trajectory(x0, y0)
by
try:
dmap.start_trajectory(x0, y0)
except InvalidIndexError:
return None