Hi Dave,

Thanks for your reply. The reason why my library sticks to 2021.09 is
because I get even more trouble with later versions of RDKit. These are two
examples of rendering with 2021 and 2022:

[image: image.png][image: image.png]

The good news is that your padding suggestion works, so I set
d2d.drawOptions().padding = 0.15 and voilá:

[image: image.png]

Amazing. Thanks!
Giammy

On Thu, 5 May 2022 at 10:32, David Cosgrove <davidacosgrov...@gmail.com>
wrote:

> Hi Giammy,
>
> On reflection overnight, you might try d2d.drawOptions().padding = 0.2 or
> something.  That should increase the amount of empty space around the
> molecule (the default is 0.05, and it's the fraction of the width/height of
> the image) such that there's enough room to show the whole annotation.
> It's a bit of a kludge, but it might work.
>
> Dave
>
> On Wed, May 4, 2022 at 4:20 PM Gianmarco Ghiandoni <ghiandon...@gmail.com>
> wrote:
>
>> Hi all,
>>
>> I am using rdkit_pypi==2021.9.4 to generate visualisation of compounds
>> with their atomic hydrogen bond strengths. In particular, I am using this
>> function to produce an SVG string:
>>
>> d2d = rdMolDraw2D.MolDraw2DSVG(fig_size[0], fig_size[1])
>>     d2d.drawOptions().annotationFontScale = 0.7
>>     d2d.DrawMolecule(
>>         rwmol,
>>         highlightAtoms=atoms_to_highlight,
>>         highlightAtomColors=idx2rgb,
>>         highlightBonds=None,
>>     )
>>     d2d.FinishDrawing()
>>     return d2d.GetDrawingText()
>>
>> Note that I am increasing the font scale to from 0.5 to 0.7 and for
>> certain molecules that produces renderings where annotations are cut out:
>>
>> [image: image.png]
>>
>> Any suggestions on how to fix this?
>>
>> Thanks,
>>
>> Giammy
>> --
>> *Gianmarco*
>> _______________________________________________
>> Rdkit-discuss mailing list
>> Rdkit-discuss@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>>
>
>
> --
> David Cosgrove
> Freelance computational chemistry and chemoinformatics developer
> http://cozchemix.co.uk
>
>

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

Reply via email to