In [4]:
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import animation
# %matplotlib widget
In [5]:
center = np.array([0, 0, 0])
radius = 3
radius_m = np.linspace(0, radius, 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]
In [6]:
fig = plt.figure(figsize = (6, 6))
ax = plt.axes(projection='3d', box_aspect = (1, 1, 1))
ax.plot(*center, color = 'blue', marker = 'o')
ax.text(center[0] + 0.25, center[1] + 0.25, center[2] + 0.25, s = 'O', fontsize = 12)
# plot_circle(theta)
ax.plot_surface(x1, y1, z1, color = 'red', alpha = 0.5)
ax.set_xlim(-5, 5)
ax.set_ylim(-5, 5)
ax.set_zlim(-5, 5)
# plt.axis('off')
Out[6]:
In [ ]:
In [ ]: