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

Magnetization plot in example 03 for "old" mathematica translation for python version using quiver3D #23

Open
testkensor opened this issue Jul 10, 2024 · 0 comments

Comments

@testkensor
Copy link

it is just hint / comment, not issue. sorry.

in original RADIA_Example05 for mathematica, magnetization plot can be shown as

(for "old" mathematica)

RadPlot3DOptions[];
ListVectorFieldPlot3D[radObjM[t], VectorHeads->True,ColorFunction-> Hue
,PlotLabel->"Magnetization in Element # "<>ToString[t]
,ViewPoint->{3,2 , 0} ,PlotRange->{All,All,{0,110}},ScaleFactor->8]

but now, it cannot be worked because mathematica abandoned ListVectorFieldPlot3D
and present ListVectorPlot3D cannot plot
{{{x1,y1,z1},{u1,v1,w1}},{{x2,y2,z2},{u2,v2,w2}},...} like data.

with python, quiver3D can plot these things.

for python,

import matplotlib.pyplot as plt
ax = plt.figure().add_subplot(projection='3d')
res=rad.ObjM(t)
vx=[res[i][0][0] for i in range(len(res))]
vy=[res[i][0][1] for i in range(len(res))]
vz=[res[i][0][2] for i in range(len(res))]
vu=[res[i][1][0]*50 for i in range(len(res))]
vv=[res[i][1][1]*50 for i in range(len(res))]
vw=[res[i][1][2]*50 for i in range(len(res))]
ax.quiver(vx, vy, vz, vu, vv, vw, pivot = 'middle') #,normalize=True,length = 15)
ax.scatter(vx, vy, vz, c='r', s=5)
plt.show()

can show similar plot.

If someone can give me advice,
please fix mathematica example for present mathematica version.....
please improve appearance of python quiver plot I wrote.....

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

1 participant