Hi, Hongbin,

Thank you very much for your help. That worked! That blog entry is a great
tutorial, in general.

So it turned out that in the following test code, I had correctly figured
out how to set atomLabels, but instead of the last two lines in my .ipynb I
had just asserted "m". (How quickly we forget.. :-} )

Best,
-P.

rdDepictor.Compute2DCoords(m)
drawer = rdMolDraw2D.MolDraw2DSVG(400, 200)
drawer.drawOptions().atomLabels[0] = '0'
drawer.DrawMolecule(m)
drawer.FinishDrawing()
svg = drawer.GetDrawingText().replace('svg:','')
SVG(svg)



On Sun, Oct 23, 2016 at 11:38 PM, 杨弘宾 <yanyangh...@163.com> wrote:

> Hi,Peter S. Shenkin,
>     I think this blog may help you draw molecule with labels and it told
> more about drawing with rdMolDraw2D.
>     http://rdkit.blogspot.com/2015/02/new-drawing-code.html
>
> ------------------------------
> Hongbin Yang
>
> *From:* Peter S. Shenkin <shen...@gmail.com>
> *Date:* 2016-10-24 10:18
> *To:* Dimitri Maziuk <dmaz...@bmrb.wisc.edu>; RDKit Discuss
> <rdkit-discuss@lists.sourceforge.net>
> *Subject:* [Rdkit-discuss] 2D drawing with atoms labeled by index
> Hi,
>
> How do you get RDKit to label the atoms in a 2D drawing with their indices?
>
> There was some discussion of this that included Dimitri Maziuk in
> September, but it wasn't clear to me whether he actually had to modify the
> underlying drawing code to get this behavior.
>
> -P.
>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to