On 22/06/2020 14:47, Francois Berenger wrote:
Dear RDKiters,

My current code looks like this:
---
        AllChem.Compute2DCoords(mol) # generate 2D conformer
        mol.SetProp("_Name", name)
        d = rdMolDraw2D.MolDraw2DSVG(200, 200)
        d.DrawMolecule(mol)

Answer to myself:
          d.DrawMolecule(mol, legend = name)

        d.FinishDrawing()
        out_fn = '%d.svg' % i
        with open(out_fn, 'w') as out:
            out.write(d.GetDrawingText())
---

How can I add some text into the generated SVG?

For example, the molecule name might be pretty useful to me.
But, I might want to annotate the molecule with whichever text I might need
in the future.

I could not find in the doc.
I could not find with some searches in rdkit's code...

Thanks a lot,
F.


_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to