Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential bug with 'start_points' argument of 'pyplot.streamplot' #6002

Closed
galaunay opened this issue Feb 14, 2016 · 3 comments
Closed

Potential bug with 'start_points' argument of 'pyplot.streamplot' #6002

galaunay opened this issue Feb 14, 2016 · 3 comments
Milestone

Comments

@galaunay
Copy link

Using pyplot.streamplot with start_points argument lead to streamline misplacement :
test
Source code :

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 = [[0, 0]]

# Base streamline plot
plt.figure()
sp1 = plt.streamplot(x, y, U, V, color=[.5]*3)

# Streamline plot with 'start_points' argument
sp2 = plt.streamplot(x, y, U, V, start_points=start_points,
                     color='r')
plt.plot(*start_points[0], marker='o', label="Starting point")
plt.plot([], [], color='r', label="Associated streamline")

# Legend and limits
plt.xlim(-10, 10)
plt.ylim(-10, 10)
plt.legend(numpoints=1)

plt.show()
@tacaswell
Copy link
Member

Looking at the source it looks like the starting point is used to seed the 'mask' layer, but I am not familiar with this code.

@Cadair There is an explicit shift to the start points you added in #4714 Can you take a look at or comment on this?

attn @tonysyu

@tacaswell tacaswell added this to the 2.1 (next point release) milestone Feb 15, 2016
@Cadair
Copy link
Contributor

Cadair commented Apr 5, 2016

Sorry I have not had a chance to look at this. Was this affected by #6011 ?

@tacaswell I do not know what the explicit shift in the start points does, I am assuming past @Cadair put it there for a reason, but he is requently proven to do silly things!

I will try and take a close look, at the code but I can't promise when.

@galaunay
Copy link
Author

galaunay commented Apr 8, 2016

Indeed, this issue should have been fixed by #6011, I just forgot to close it.
But an informed opinion on what have been done in #6011 concerning starting_points (commit 71b9ae8) would be great.

@galaunay galaunay closed this as completed Apr 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants