-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Add new num_arrows option to streamplot #27617
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
3ac7264
Add new narrows option to streamplot
clairefi0 7ae40ad
Add multiple arrows example
dstansby 88cb2d7
Tidy up alt text in what's new example
dstansby a746ce1
narrows > n_arrows
dstansby b2843d5
Fix new streamplot type stub
dstansby 690d255
Rename n_arrows to num_arrows
QuLogic 0a5c227
Fix handling of stream line width with multiple arrows
QuLogic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Multiple arrows on a streamline | ||
------------------------------- | ||
|
||
A new ``num_arrows`` argument has been added to `~matplotlib.axes.Axes.streamplot` that | ||
allows more than one arrow to be added to each streamline: | ||
|
||
.. plot:: | ||
:include-source: true | ||
:alt: One chart showing a streamplot. Each streamline has three arrows. | ||
|
||
import matplotlib.pyplot as plt | ||
import numpy as np | ||
|
||
w = 3 | ||
Y, X = np.mgrid[-w:w:100j, -w:w:100j] | ||
U = -1 - X**2 + Y | ||
V = 1 + X - Y**2 | ||
|
||
fig, ax = plt.subplots() | ||
ax.streamplot(X, Y, U, V, num_arrows=3) | ||
|
||
plt.show() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file removed
BIN
-21.3 KB
lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_linewidth.pdf
Binary file not shown.
Binary file modified
BIN
+1.93 KB
(100%)
lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_linewidth.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a little bit unclear to me why this information is important/difference between steps and distance - is there a place where this is discussed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put this in because before I worked out why not, it was a surprise to me that the arrows weren't visually equidistant along the streamline. Happy to drop this if it causes more confusion than it clears up, or try and clarify it a bit?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clarify, but going by your reply I think something like this is what I'm after"
Where i can just look up the diff between steps and distance