Hi,

Unfortunately Draw.MolToFile uses the old drawing code, which doesn't
support the output of legends with the molecules.
You can get PNG or SVG data with molecule names, and then write that to a
file, but PDF output is not supported.

Best,
-greg


On Sun, Sep 16, 2018 at 4:05 PM Bakary N'tji Diallo <diallobaka...@gmail.com>
wrote:

> Dear all
> Hope you are doing well
>
> How to draw mol object with their name.
> With MolsToGridImage
> Draw.MolsToGridImage([ms[0]],molsPerRow=1,subImgSize=(200,200),
> legends=["test"])
> The legend parameter is assigned as molecule name and is drawn.
> But I'd like to use Draw.MolToFile.
> Draw.MolToFile(ms[0], 'cdk2_mol1.pdf' , size=(300, 300),
> legends=["Test"],  imageType="pdf")
>
> Unfortunately the legend parameter doesn't work here.
> I am not sure if it is possible as I can't find it in the documentation:
> http://www.rdkit.org/Python_Docs/rdkit.Chem.Draw-module.html#MolToFile
> It'd be great if someone can help me out.
>
> Thanks
> Best regards.
>
>
> --
>
> Bakary
>
> _______________________________________________
> 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