Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

AddU,V andC setter toQuiver#26410

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
ericpre wants to merge7 commits intomatplotlib:main
base:main
Choose a base branch
Loading
fromericpre:quiver_setters
Open
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletionsdoc/users/next_whats_new/add_Quiver_setters.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
Add ``U``, ``V`` and ``C`` setter to ``Quiver``
-----------------------------------------------

The ``U``, ``V`` and ``C`` values of the `~matplotlib.quiver.Quiver`
can now be changed after the collection has been created.

.. plot::
:include-source: true

import matplotlib.pyplot as plt
from matplotlib.quiver import Quiver
import numpy as np

fig, ax = plt.subplots()
X = np.arange(-10, 10, 1)
Y = np.arange(-10, 10, 1)
U, V = np.meshgrid(X, Y)
C = np.hypot(U, V)
# When X and Y are 1D and U, V are 2D, X, Y are expanded to 2D
# using X, Y = np.meshgrid(X, Y)
qc = ax.quiver(X, Y, U, V, C)

qc.set_U(U/5)

# The number of arrows can also be changed.

# Get new X, Y, U, V, C
X = np.arange(-10, 10, 2)
Y = np.arange(-10, 10, 2)
U, V = np.meshgrid(X, Y)
C = np.hypot(U, V)
# Use 2D X, Y coordinate (X, Y will not be expanded to 2D)
X, Y = np.meshgrid(X, Y)

# Set new values
qc.set_XYUVC(X, Y, U, V, C)
Loading

[8]ページ先頭

©2009-2025 Movatter.jp