vector field plot with 2 matrices quiverConcatenating two std::vectorsHow to find out if an item is present in a std::vector?Why is Java Vector (and Stack) class considered obsolete or deprecated?What is the easiest way to initialize a std::vector with hardcoded elements?Appending a vector to a vectorPlot two graphs in same plot in RHow to put the legend out of the plotSave plot to image file instead of displaying it using MatplotlibAlgorithm to slide vector across a vectorFinding rotation between vectors in Matlab, from matrices of x and y components
In How Many Ways Can We Partition a Set Into Smaller Subsets So The Sum of the Numbers In Each Subset Is Equal?
What is the word for interior with a circle
Why is python script running in background consuming 100 % CPU?
Does the Aboleth have expertise in history and perception?
Find the 3D region containing the origin bounded by given planes
Why aren't satellites disintegrated even though they orbit earth within earth's Roche Limits?
pwaS eht tirsf dna tasl setterl fo hace dorw
Hotel booking: Why is Agoda much cheaper than booking.com?
About sklearn.metrics.average_precision_score documentation
Vehemently against code formatting
Germany rejected my entry to Schengen countries
Is it a good idea to teach algorithm courses using pseudocode instead of a real programming language?
Why would Thor need to strike a building with lightning to attack enemies?
In Dutch history two people are referred to as "William III"; are there any more cases where this happens?
Would it be possible to set up a franchise in the ancient world?
Why favour the standard WP loop over iterating over (new WP_Query())->get_posts()?
Who is frowning in the sentence "Daisy looked at Tom frowning"?
Failing students when it might cause them economic ruin
Why does the U.S military use mercenaries?
Character had a different name in the past. Which name should I use in a flashback?
Could a chemically propelled craft travel directly between Earth and Mars spaceports?
Can a Warforged have a ranged weapon affixed to them like an armblade?
Why did Nick Fury not hesitate in blowing up the plane he thought was carrying a nuke?
Should I twist DC power and ground wires from a power supply?
vector field plot with 2 matrices quiver
Concatenating two std::vectorsHow to find out if an item is present in a std::vector?Why is Java Vector (and Stack) class considered obsolete or deprecated?What is the easiest way to initialize a std::vector with hardcoded elements?Appending a vector to a vectorPlot two graphs in same plot in RHow to put the legend out of the plotSave plot to image file instead of displaying it using MatplotlibAlgorithm to slide vector across a vectorFinding rotation between vectors in Matlab, from matrices of x and y components
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I have 2 nxn matrices, 1 containing the x-component of the vector field and the other the y-component. Additionally I have 2 lists of each length n with the x, and y position respectively.
now I would like to create a grid with my x-y values from the lists as scale and the vector field consisting of the 2 matrices (the arrows should consist of the x,y position of each matrix) but it doesnt work. Im quite desperate already and hope Ill find help! thanks a lot!
plt.quiver(x,y,matrix1,matrix2)
plt.show()
, where x and y are lists of n and matrix 1 and matrix 2 are matrices of nxn
python vector plot 2d
add a comment |
I have 2 nxn matrices, 1 containing the x-component of the vector field and the other the y-component. Additionally I have 2 lists of each length n with the x, and y position respectively.
now I would like to create a grid with my x-y values from the lists as scale and the vector field consisting of the 2 matrices (the arrows should consist of the x,y position of each matrix) but it doesnt work. Im quite desperate already and hope Ill find help! thanks a lot!
plt.quiver(x,y,matrix1,matrix2)
plt.show()
, where x and y are lists of n and matrix 1 and matrix 2 are matrices of nxn
python vector plot 2d
add a comment |
I have 2 nxn matrices, 1 containing the x-component of the vector field and the other the y-component. Additionally I have 2 lists of each length n with the x, and y position respectively.
now I would like to create a grid with my x-y values from the lists as scale and the vector field consisting of the 2 matrices (the arrows should consist of the x,y position of each matrix) but it doesnt work. Im quite desperate already and hope Ill find help! thanks a lot!
plt.quiver(x,y,matrix1,matrix2)
plt.show()
, where x and y are lists of n and matrix 1 and matrix 2 are matrices of nxn
python vector plot 2d
I have 2 nxn matrices, 1 containing the x-component of the vector field and the other the y-component. Additionally I have 2 lists of each length n with the x, and y position respectively.
now I would like to create a grid with my x-y values from the lists as scale and the vector field consisting of the 2 matrices (the arrows should consist of the x,y position of each matrix) but it doesnt work. Im quite desperate already and hope Ill find help! thanks a lot!
plt.quiver(x,y,matrix1,matrix2)
plt.show()
, where x and y are lists of n and matrix 1 and matrix 2 are matrices of nxn
python vector plot 2d
python vector plot 2d
asked Mar 23 at 18:29
Richard EisensteinRichard Eisenstein
11
11
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
This code correctly generates a quiver plot with data of the dimensions specified.
import numpy as np
import matplotlib.pyplot as plt
# Generate data
n = 10
x = np.random.rand(n)
y = np.random.rand(n)
matrix1 = np.random.rand(n, n) - 0.5
matrix2 = np.random.rand(n, n) - 0.5
# Create quiver plot
plt.figure()
plt.quiver(x, y, matrix1, matrix2)
plt.show()
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55317069%2fvector-field-plot-with-2-matrices-quiver%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
This code correctly generates a quiver plot with data of the dimensions specified.
import numpy as np
import matplotlib.pyplot as plt
# Generate data
n = 10
x = np.random.rand(n)
y = np.random.rand(n)
matrix1 = np.random.rand(n, n) - 0.5
matrix2 = np.random.rand(n, n) - 0.5
# Create quiver plot
plt.figure()
plt.quiver(x, y, matrix1, matrix2)
plt.show()
add a comment |
This code correctly generates a quiver plot with data of the dimensions specified.
import numpy as np
import matplotlib.pyplot as plt
# Generate data
n = 10
x = np.random.rand(n)
y = np.random.rand(n)
matrix1 = np.random.rand(n, n) - 0.5
matrix2 = np.random.rand(n, n) - 0.5
# Create quiver plot
plt.figure()
plt.quiver(x, y, matrix1, matrix2)
plt.show()
add a comment |
This code correctly generates a quiver plot with data of the dimensions specified.
import numpy as np
import matplotlib.pyplot as plt
# Generate data
n = 10
x = np.random.rand(n)
y = np.random.rand(n)
matrix1 = np.random.rand(n, n) - 0.5
matrix2 = np.random.rand(n, n) - 0.5
# Create quiver plot
plt.figure()
plt.quiver(x, y, matrix1, matrix2)
plt.show()
This code correctly generates a quiver plot with data of the dimensions specified.
import numpy as np
import matplotlib.pyplot as plt
# Generate data
n = 10
x = np.random.rand(n)
y = np.random.rand(n)
matrix1 = np.random.rand(n, n) - 0.5
matrix2 = np.random.rand(n, n) - 0.5
# Create quiver plot
plt.figure()
plt.quiver(x, y, matrix1, matrix2)
plt.show()
answered Mar 23 at 18:42
NathanielNathaniel
2,210314
2,210314
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55317069%2fvector-field-plot-with-2-matrices-quiver%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown