Hi again,

I've managed to make it work. Please find the working code attached as a
notebook. Unfortunately, it seam there is a small bug with SetScale: if the
diff in min/max x or y in the minimum point and maximum point is zero or
close to zero, then the molecules are broken. I've added a margin of 1 to
each sides and it worked.

----
Pozdrawiam,  |  Best regards,
Maciek Wójcikowski
mac...@wojcikowski.pl

2017-09-14 20:53 GMT+02:00 Maciek Wójcikowski <mac...@wojcikowski.pl>:

> I've tried that, but ended up with molecules out of picture. I'll try
> again tomorrow and ping back here should I succeed. The real problem were
> two atom molecules, which have delta x or y = 0, such as C=0 or CN.
>
> ----
> Pozdrawiam,  |  Best regards,
> Maciek Wójcikowski
> mac...@wojcikowski.pl
>
> 2017-09-14 17:21 GMT+02:00 Greg Landrum <greg.land...@gmail.com>:
>
>> Hi Maciek,
>>
>> You can do this by calling setScale() method on MolDraw2D(). There's not
>> a decent python example around yet (would be something for the cookbook I
>> suppose), but the C++ code isn't too complex and demonstrates how it works:
>> https://github.com/rdkit/rdkit/blob/master/Code/GraphMol/
>> MolDraw2D/test1.cpp#L1962
>>
>> Hope this helps,
>> -greg
>>
>>
>> On Thu, Sep 14, 2017 at 10:24 AM, Maciek Wójcikowski <
>> mac...@wojcikowski.pl> wrote:
>>
>>> Hi RDKitters!
>>>
>>> Quick question: is there a way to force drawing to output molecules on a
>>> grid image or separate in fixed scale (i.e. constant/matching bond length)?
>>>
>>> ----
>>> Pozdrawiam,  |  Best regards,
>>> Maciek Wójcikowski
>>> mac...@wojcikowski.pl
>>>
>>> ------------------------------------------------------------
>>> ------------------
>>> 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
>>>
>>>
>>
>

Attachment: fixed_bond_drawing.ipynb
Description: application/ipynb

------------------------------------------------------------------------------
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