I am trying to plot a LG beam equation in python where Electric field depends on r (transverse distance from propagation axis), theta (rotation Parameter), and z (propagation distance) and then electric field is calculated
I have made
r = np.linspace(0,10,100) theta = np.linspace(0,np.pi,100) z as np.linspace(0,80,100)
then E = function of (r,z,theta)
The issue is I am trying to plot E but not successfull in plotting values of E as scatter or surface but not getting it as expected.
What i want to do is to plot values of E with respect to three axis r , z and theta
Can anyone please guide me how to achieve this using python or any other software
r = np.linspace(0,10,100); theta = np.linspace(0,np.pi,100); z = np.linspace(0,80,100)are only 1-D arrays, so the resulting plot will be a flat 3-D line. You need to usenp.meshgridor array broadcasting to make grids: numpy.org/doc/stable/user/basics.broadcasting.html