download_caffeine#
- download_caffeine(load: bool = True) PolyData | str[source]#
Download the caffeine molecule.
Added in version 0.44.0.
- Parameters:
- Returns:
- output
pyvista.PolyData|str DataSet or filename depending on
load.
- output
Examples#
Download Python source code | Download Jupyter notebook
>>> import pyvista as pv
>>> from pyvista import examples
>>> filename = examples.download_caffeine(load=False)
>>> reader = pv.get_reader(filename)
>>> poly = reader.read()
Add atoms and bonds to the plotter.
>>> pl = pv.Plotter()
>>> atoms = pl.add_mesh(poly.glyph(geom=pv.Sphere(radius=0.1)), color='red')
>>> bonds = pl.add_mesh(poly.tube(radius=0.1), color='gray')
>>> pl.show(cpos='xy')
See also
- Caffeine Dataset
See this dataset in the Dataset Gallery for more info.