In [1]:
import matplotlib.pyplot as plt
import numpy as np
# %matplotlib widget
In [26]:
center = np.array([0, 0, 0])
radius = 5
radius_m = np.linspace(11, 16, 2)
theta = np.linspace(0, -2*np.pi, 50)
x1 = np.outer(radius_m, np.cos(theta)) + center[0]
y1 = np.outer(radius_m, np.sin(theta)) + center[1]
z1 = np.zeros(y1.shape) + center[2]
theta = np.linspace(0, 2*np.pi, 100)
alpha = np.linspace(0, np.pi, 100)
x = radius*np.outer(np.cos(theta), np.sin(alpha)) + center[0]
y = radius*np.outer(np.sin(theta), np.sin(alpha)) + center[1]
z = radius*np.outer(np.ones(theta.shape), np.cos(alpha)) + center[2]
In [29]:
fig = plt.figure(figsize = (6, 6))
ax = plt.axes(projection='3d', box_aspect = (1, 1, 1))
ax.plot_surface(x1, y1, z1, color = 'moccasin', alpha = 1)
ax.plot_surface(x, y, z, color = 'palegoldenrod')
ax.set_xlim(-10, 10)
ax.set_ylim(-10, 10)
ax.set_zlim(-10, 10)
plt.axis('off')
Out[29]:
In [ ]:
In [ ]: