- class rmgpy.molecule.draw.ReactionDrawer(options=None)¶
This class provides functionality for drawing chemical reactions using the skeletal formula of each reactant and product molecule via the Cairo 2D graphics engine. The most common use case is simply:
ReactionDrawer().draw(reaction, file_format='png', path='reaction.png')
Reactionobject to draw. You can also pass a dict of options to the constructor to affect how the molecules are drawn.
- draw(reaction, file_format, path=None)¶
Draw the given reaction using the given image file_format - pdf, svg, ps, or png. If path is given, the drawing is saved to that location on disk.
This function returns the Cairo surface and context used to create the drawing, as well as a bounding box for the molecule being drawn as the tuple (left, top, width, height).