In [1]:
import sys
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
%matplotlib inline
sys.path.append('../src/')
from ten.utils import generate_random_points_in_sphere
In [7]:
num_points = 20
colors = np.random.random(10)
points = generate_random_points_in_sphere(num_points, 1)
point = generate_random_points_in_sphere(1, 0.5)
point_new = generate_random_points_in_sphere(1, 0.5)
u = np.linspace(0, 2 * np.pi, 100)
v = np.linspace(0, np.pi, 100)
x = 1 * np.outer(np.cos(u), np.sin(v))
y = 1 * np.outer(np.sin(u), np.sin(v))
z = 1 * np.outer(np.ones(np.size(u)), np.cos(v))
x_l = [p[0] for p in points]
y_l = [p[1] for p in points]
z_l = [p[2] for p in points]
In [17]:
fig = plt.figure(figsize=(12,12))
ax = fig.add_subplot(111, projection='3d')
# Grafico de la esfera
ax.plot_wireframe(x, y, z, rstride=10, cstride=10, color='0.3')
# Grafico de los puntos azules
ax.scatter(points[:,0], points[:,1], points[:,2], s=140)
# Grafico punto rojo
ax.scatter(point[:,0], point[:,1], point[:,2], c='r', s=200)
plt.savefig('fig3.svg')
In [18]:
fig = plt.figure(figsize=(12,12))
ax = fig.add_subplot(111, projection='3d')
# Esfera
ax.plot_wireframe(x, y, z, rstride=10, cstride=10, color='0.3')
# Puntos azules
ax.scatter(points[:,0], points[:,1], points[:,2], s=140)
# Lineas entre el punto rojo y los azules
for i in range(len(x_l)):
ax.plot([x_l[i], point[0][0]], [y_l[i], point[0][1]], [z_l[i], point[0][2]], 'k')
# Punto rojo
ax.scatter(point[:,0], point[:,1], point[:,2], c='r', s=200)
plt.savefig('fig4.svg')
In [19]:
# Para el color rojo mas tenue
reds = plt.get_cmap("Reds")
fig = plt.figure(figsize=(12,12))
ax = fig.add_subplot(111, projection='3d')
# Esfera
ax.plot_wireframe(x, y, z, rstride=10, cstride=10, color='0.3')
# Puntos azules
ax.scatter(points[:,0], points[:,1], points[:,2], s=140)
# Lineas entre el punto rojo y los azules
for i in range(len(x_l)):
ax.plot([x_l[i], point_new[0][0]], [y_l[i], point_new[0][1]], [z_l[i], point_new[0][2]], 'k')
# Vieja posicion exciton (punto gris)
ax.scatter(point[:,0], point[:,1], point[:,2], c=reds(0.3), s=200)
# Linea del mov del exciton
ax.plot([point[0][0], point_new[0][0]], [point[0][1], point_new[0][1]], [point[0][2], point_new[0][2]], 'k--')
# Nueva posicion exciton (punto rojo)
ax.scatter(point_new[:,0], point_new[:,1], point_new[:,2], c='r', s=200)
plt.savefig('fig5.svg')
In [16]:
num_points = 20
colors = np.random.random(10)
points = generate_random_points_in_sphere(num_points, 1)
point = generate_random_points_in_sphere(1, 0.5)
point_new = generate_random_points_in_sphere(1, 0.5)
u = np.linspace(0, 2 * np.pi, 100)
v = np.linspace(0, np.pi, 100)
x = 1 * np.outer(np.cos(u), np.sin(v))
y = 1 * np.outer(np.sin(u), np.sin(v))
z = 1 * np.outer(np.ones(np.size(u)), np.cos(v))
x_l = [p[0] for p in points]
y_l = [p[1] for p in points]
z_l = [p[2] for p in points]
# Para el color rojo mas tenue
reds = plt.get_cmap("Reds")
fig = plt.figure(figsize=(12,12))
ax = fig.add_subplot(111, projection='3d')
# Esfera
ax.plot_wireframe(x, y, z, rstride=10, cstride=10, color='0.3')
# Puntos azules
ax.scatter(points[:,0], points[:,1], points[:,2], s=140)
# Lineas entre el punto rojo y los azules
for i in range(len(x_l)):
ax.plot([x_l[i], point_new[0][0]], [y_l[i], point_new[0][1]], [z_l[i], point_new[0][2]], 'k')
# Vieja posicion exciton (punto gris)
ax.scatter(point[:,0], point[:,1], point[:,2], c=reds(0.3), s=200)
# Linea del mov del exciton
ax.plot([point[0][0], point_new[0][0]], [point[0][1], point_new[0][1]], [point[0][2], point_new[0][2]], 'k--')
# Nueva posicion exciton (punto rojo)
ax.scatter(point_new[:,0], point_new[:,1], point_new[:,2], c='r', s=200)
#plt.savefig('fig5.svg')
Out[16]:
In [2]:
#Este css esta basado en el de @LorenaABarba y su grupo
from IPython.core.display import HTML
css_file = 'css/personal.css'
HTML(open(css_file, "r").read())
Out[2]:
El código esta licenciado bajo MIT.
La documentación bajo:
<span xmlns:dct="http://purl.org/dc/terms/" property="dct:title">TEN</span> by <span xmlns:cc="http://creativecommons.org/ns#" property="cc:attributionName">Laboratorio de Microscopia Óptica Avanzada - UNRC</span> is licensed under a Creative Commons Attribution 4.0 International License.
Based on a work at <a xmlns:dct="http://purl.org/dc/terms/" href="https://github.com/pewen/ten" rel="dct:source">https://github.com/pewen/ten</a>