Skip to content

[BUG] Short Description #442

@hexiongwu1995

Description

@hexiongwu1995

Error Message: "Axes3D.plot() missing 2 required positional arguments: 'xs' and 'ys'"

# Create a 3D Torus
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import LightSource

R, r = 3, 0.8
polar= np.linspace(0, 2*np.pi, num=20, endpoint=True)
phi= np.linspace(0, 2*np.pi, num=20, endpoint=True)
Polar, Phi= np.meshgrid(polar, phi)
x= (R + r* np.cos(Polar))* np.cos(Phi)
y= (R+ r* np.cos(Polar))* np.sin(Phi)
z= r* np.sin(Polar)

fig= plt.figure(figsize=(6,4))
ax= fig.add_subplot(projection= '3d')

ax.plot_surface(x, y, z, color= 'blue', shade=True, lightsource= LightSource(azdeg=270, altdeg=45) )

ax.set(zlim=(-4,4))
plt.show()

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions