Ask Your Question
1

3dplot molecule drawing

asked 2019-01-02 19:08:32 +0100

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2019-01-02 23:14:49 +0100

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)
edit flag offensive delete link more

Comments

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

Spreeter gravatar imageSpreeter ( 2019-01-03 14:52:02 +0100 )edit

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

sage: text3d("plop",(1,2,0))
tmonteil gravatar imagetmonteil ( 2019-01-03 15:53:43 +0100 )edit

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: 2019-01-02 19:08:32 +0100

Seen: 836 times

Last updated: Jan 02 '19