Ask Your Question
1

3dplot molecule drawing

asked 6 years ago

Spreeter gravatar image

Hello! I have to make a 3d model of the sulfur acid molecule, so that the name and mass of the molecules are visible on it and the bonds too(if 1 or 2 between 2 atoms). Can someone send a code or some info about 3d plotting?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
3

answered 6 years ago

tmonteil gravatar image

You can draw a sphere as follows:

sage: sphere((0,0,0), size=1, color='red')

You can add plots together:

sage: sphere((0,0,0), size=1, color='red') + sphere((2,0,0), size=1.5, color='green')

You can ensure that all the axes are on the same scale, with aspect_ratio=1:

sage: sphere((0,0,0), size=1, color='red') + sphere((2,0,0), size=1.5, color='green', aspect_ratio=1)
Preview: (hide)
link

Comments

and how can i write something in/on a sphere?

Spreeter gravatar imageSpreeter ( 6 years ago )

You can use text3d and add it to the previous plot:

sage: text3d("plop",(1,2,0))
tmonteil gravatar imagetmonteil ( 6 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 6 years ago

Seen: 934 times

Last updated: Jan 02 '19