Skip to content

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

@testkensor

Description

@testkensor

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.....

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions