¡@

Home 

python Programming Glossary: np.pi

Python/matplotlib : plotting a 3d cube, a sphere and a vector?

http://stackoverflow.com/questions/11140163/python-matplotlib-plotting-a-3d-cube-a-sphere-and-a-vector

0 ax.plot3D zip s e color b #draw sphere u v np.mgrid 0 2 np.pi 20j 0 np.pi 10j x np.cos u np.sin v y np.sin u np.sin v z np.cos.. zip s e color b #draw sphere u v np.mgrid 0 2 np.pi 20j 0 np.pi 10j x np.cos u np.sin v y np.sin u np.sin v z np.cos v ax.plot_wireframe..

How to draw diagrams like this?

http://stackoverflow.com/questions/14824893/how-to-draw-diagrams-like-this

dim dim dim 0 Z3 Y3 angle r 7 M 1000 th np.linspace 0 2 np.pi M x y z r np.cos th r np.sin th angle r np.sin th ax.plot_surface..

Fitting a 3D array of data to a 1D function with numpy or scipy

http://stackoverflow.com/questions/15094619/fitting-a-3d-array-of-data-to-a-1d-function-with-numpy-or-scipy

numpy as np def f x p1 p2 p3 p4 return p1 p2 np.sin 2 np.pi p3 x p4 #fit function def fit data guess n data.shape 0 leng.. numpy as np def f x p1 p2 p3 p4 return p1 p2 np.sin 2 np.pi p3 x p4 sx 50 # size x sy 200 # size y sz 100 # size z # creating.. sy sz 0.8 tmp 2 np.ones sy sz tmp 3 np.ones sy sz np.pi 4 param_ref np.empty 4 sy sz sx # param_ref in this shape will..

ode integration in python versus mathematica results

http://stackoverflow.com/questions/16222302/ode-integration-in-python-versus-mathematica-results

param of the moon mu mue mum omega np.sqrt mu r12 3 nu np.pi 4 # true anomaly pick yourself xl4 r12 2 4671 # x location.. 2 y0 2 2 1.21 print Burnout velocity is vbo gamma 0.4678 np.pi 180 # flight path angle pick yourself vx vbo np.sin gamma np.cos.. 'r' # adding the Lagrange point phi np.linspace 0 2 np.pi 100 theta np.linspace 0 np.pi 100 xm 2000 np.outer np.cos phi..

Inverse Distance Weighted (IDW) Interpolation with Python

http://stackoverflow.com/questions/3104781/inverse-distance-weighted-idw-interpolation-with-python

eps p def terrain x ~ rolling hills return np.sin 2 np.pi cycle np.mean x axis 1 known np.random.uniform size N Ndim .5..

matplotlib Update a Plot

http://stackoverflow.com/questions/4098131/matplotlib-update-a-plot

as plt import numpy as np x np.linspace 0 6 np.pi 100 y np.sin x # You probably won't need this if you're embedding.. line objects thus the comma for phase in np.linspace 0 10 np.pi 500 line1.set_ydata np.sin x phase fig.canvas.draw share improve..

matplotlib: adding second axes() with transparent background?

http://stackoverflow.com/questions/7761778/matplotlib-adding-second-axes-with-transparent-background

with transparent background Define data x np.linspace 0 2 np.pi 100 y 2 np.sin x Plot fig plt.figure ax plt.axes fig.add_subplot.. 'outward' 25 ax.plot range 10 'r ' x np.linspace 0 6 np.pi newax.plot x 0.001 np.cos x 'g ' plt.show Note that the y axis.. ax.set_ylabel 'Red Y axis' color 'red' x np.linspace 0 6 np.pi newax.plot x 0.001 np.cos x 'g ' newax.set_xlabel 'Green X axis'..

why is plotting with Matplotlib so slow?

http://stackoverflow.com/questions/8955869/why-is-plotting-with-matplotlib-so-slow

as plt import numpy as np import time x np.arange 0 2 np.pi 0.01 y np.sin x fig axes plt.subplots nrows 6 styles 'r ' 'g.. as plt import numpy as np import time x np.arange 0 2 np.pi 0.1 y np.sin x fig axes plt.subplots nrows 6 styles 'r ' 'g.. as animation import numpy as np x np.arange 0 2 np.pi 0.1 y np.sin x fig axes plt.subplots nrows 6 styles 'r ' 'g..