Hello there, I’m solving the Maxwell’s equation numerically in R^3, and I’m trying to create a plot which draws a vector in the point in 3D space. Essentially, I’m trying to make a plot that looks like the following, minus the extra solid lines.
To put my code succinctly, I have two vectors, \vec{E}(x,y,z) and \vec{B}(x,y,z), and a grid in each spatial coordinate, where each component of the vector has a given value associated with it. In Julia, this is being represented by an N \times N \times N matrix, meaning that E_x, E_y and E_z is represented by an Array{Float64, 3}
of size N \times N \times N, with the same taking place for vector \vec{B}.
What I would like to do was to issue a plot command that looked like,
vectorplot(xgrid, ygrid, zgrid, vector=(Ex, Ey, Ez))
with the code being made in such a way that for the point (xgrid[1], ygrid[1], zgrid[1])
it would display a vector with components (Ex[1], Ex[2], Ex[3])
.
However, as far as I am aware, there is no such function. When using the Plots package I can make use of quiver to plot a vector field, but it’s arguments are of the type
quiver([x₀, x₁, ..., xₙ], [y₀, y₁, ..., yₙ], quiver=([a₀, a₁, ..., aₙ], [b₀, b₁, ..., bₙ]))
which plots vectors of size (a_i, b_i) with origin at (x_i, y_i). Even with other libraries, such as Gaston, the syntax is similar.
I could take the output of my simulation and change it accordingly to fit this syntax, however, it seems inefficient, given that this simulation might grow large, and, more frankly, I expect that there is a more ‘plug-n-play’ type of solution, developed by somebody who already faced the same issue that I am currently facing.
Could somebody provide me with some insight on what could be the best way to make such a plot happen?