#!/usr/bin/python
from mpl_toolkits import mplot3d
import numpy as np
import matplotlib.pyplot as plt


func=np.loadtxt("lorentz_prooton.dat")
x=func[:,0]
y=func[:,1]
z=func[:,2]

fig=plt.figure(figsize=(10,10))
p=plt.axes(projection="3d")
p.set_xlim(-40000,40000)
p.set_ylim(-40000,40000)
p.set_zlim(-40000,40000)
p.plot(x,y,z,color="red")

u = np.linspace(0, 2 * np.pi, 26)
v = np.linspace(0, np.pi, 14)

xs = 6378 * np.outer(np.cos(u), np.sin(v))
ys = 6378 * np.outer(np.sin(u), np.sin(v))
zs = 6378 * np.outer(np.ones(np.size(u)), np.cos(v))
p.plot_surface(xs, ys, zs, rstride=1, cstride=1, color='green', shade=1)

plt.grid()
plt.show()