Hi Dimitri,

the bit evidenced in red should allow you to achieve what you need:

mol = Chem.MolFromSmiles('C1CCCCN1')

rdDepictor.Compute2DCoords(mol)

dr = rdMolDraw2D.MolDraw2DSVG(300, 300)

opts = dr.drawOptions()

opts.clearBackground=False

dr.DrawMolecule(mol)

dr.FinishDrawing()

'rect' in dr.GetDrawingText()
False

Cheers,
p.

On 11/01/18 22:52, Dimitri Maziuk via Rdkit-discuss wrote:
Hi all,

I finally got around to playing w/ drawing code in the current version
and I like it, but how do I set background colour to transparent?


  dr = rdkit.Chem.Draw.rdMolDraw2D.MolDraw2DSVG( 1000, 1000 )

results in

<svg:rect style='opacity:1.0;fill:#FFFFFF;stroke:none' width='1000'
height='1000' x='0' y='0'> </svg:rect>

in the output, which for now I'll just post-process away.

Thx,




_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to