What software is available for 3D diagrams and graphs? I'm looking for software to generate pretty 3D diagrams and graphics for scientific publications, for example something like this: http://www.123rf.com/photo_9355990_space-fill-ball-and-stick-models-of-methanol.html

Ideally, the software should also allow me to somehow allow me to place objects programmatically, if I would like 100s of spheres.
This won't help with graphs, but for making molecular diagrams I highly recommend the open source Jmol, which is free for Windows, Mac, and Linux. It lets you create all sorts of molecules and export them as Java applets, images, or animations.