Hi Michal,
you're going to kick yourself. ;-)
On Wed, Feb 12, 2014 at 4:06 PM, Michał Nowotka <[email protected]> wrote:
> I want to get SVG image for some compound:
>
> import cairo
> from rdkit import Chem
> import StringIO
> from rdkit.Chem.Draw import cairoCanvas
>
> imageData = StringIO.StringIO()
> surf = cairo.SVGSurface(imageData,200,200)
> ctx = cairo.Context(surf)
> mol =
> Chem.MolFromSmiles("O=C(O)C2N3C(=O)C(NC(=O)C(c1ccc(O)cc1)NC(=O)C(N)CC(=O)NC)C3SC2(C)C")
> canv = cairoCanvas.Canvas(ctx=ctx, size=(200,200), imageType='svg')
> Chem.Draw.MolToImage(mol, size=(200,200))
> canv.flush()
> surf.finish()
> imageData.getvalue()
>
>
You've forgotten the canvas=canv argument to MolToImage.
-greg
------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience. Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss