Re: [Rdkit-discuss] Change font size in atom.SetProp("atomNote")
Open-Source Cheminformatics and Machine Learning
Brought to you by:
glandrum
|
From: Gianmarco G. <ghi...@gm...> - 2022-03-28 15:20:27
|
Great. Thanks. I will test this out straight away.
Giammy
On Mon, 28 Mar 2022 at 16:11, Paolo Tosco <pao...@gm...>
wrote:
> Hi Gianmarco,
>
> sure, e.g.:
>
> d2d = rdMolDraw2D.MolDraw2DSVG(200, 200)
> d2d.drawOptions().annotationFontScale = 0.7
> d2d.drawOptions().addAtomIndices = True
> d2d.DrawMolecule(Chem.MolFromSmiles("c1ccccn1"))
> d2d.FinishDrawing()
> SVG(d2d.GetDrawingText())
> [image: image.png]
>
> Cheers,
> p.
>
> On Mon, Mar 28, 2022 at 5:03 PM Gianmarco Ghiandoni <ghi...@gm...>
> wrote:
>
>> Hello Paolo,
>>
>> Thanks for that. Is it possible to configure that parameter against the
>> rdMolDraw2D? I am using it to get the SVG string for my molecule:
>>
>> d2d = rdMolDraw2D.MolDraw2DSVG(fig_size[0], fig_size[1])
>> d2d.DrawMolecule(
>> rwmol,
>> highlightAtoms=atoms_to_highlight,
>> highlightAtomColors=idx2rgb,
>> highlightBonds=None,
>> )
>> d2d.FinishDrawing()
>> return d2d.GetDrawingText()
>>
>> Giammy
>>
>> On Mon, 28 Mar 2022 at 14:00, Paolo Tosco <pao...@gm...>
>> wrote:
>>
>>> Hi Gianmarco,
>>>
>>> the setting that you need to adjust is
>>>
>>> annotationFontScale
>>> <https://www.rdkit.org/docs/cppapi/structRDKit_1_1MolDrawOptions.html#a6cf64fa7c9f2c08870914430f6a46282>
>>>
>>> e.g.
>>> IPythonConsole.drawOptions.annotationFontScale = 0.7
>>>
>>> The default scale is 0.5.
>>>
>>> Cheers,
>>> p.
>>>
>>>
>>> On Mon, Mar 28, 2022 at 2:31 PM Gianmarco Ghiandoni <
>>> ghi...@gm...> wrote:
>>>
>>>> Hi all,
>>>>
>>>> I am using RDKit to set calculated values to atoms as shown below and I
>>>> would like to know whether it is possible or not to change the font size to
>>>> make it slightly bigger.
>>>>
>>>> # For each atom, set the property "atomNote" to a index+1 of the atom atom.SetProp("atomNote", str(atom.GetIdx()+1))
>>>>
>>>>
>>>> Thanks,
>>>>
>>>> Giammy
>>>>
>>>> --
>>>> *Gianmarco*
>>>> _______________________________________________
>>>> Rdkit-discuss mailing list
>>>> Rdk...@li...
>>>> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>>>>
>>>
>>
>> --
>> *Gianmarco*
>>
>
--
*Gianmarco*
|