Dear RDKit team,

I'm trying to draw a molecule on a spectrum plot from Matplotlib using MolToImage. This is some abbreviated code:

```
import matplotlib.pyplot as plt
from rdkit import Chem
from rdkit.Chem import Draw

fig, ax = plt.subplots()

ax.plot(...)

im = Draw.MolToImage(Chem.MolFromSmiles(smiles))
ax.imshow(im, aspect='auto', extent=(x, x+width, y, y + height))

plt.savefig('fig.pdf')
plt.close()
```

Unfortunately the quality of the molecule drawing is rather poor (see attachment; nonsensical spectrum and molecule). This seems to be true for non-SVG drawing in general, and unfortunately it's not really possible to combine SVG output with Matplotlib functionality.

Is there any way I can improve the quality of the MolToImage output? I've tried to change some of the DrawingOptions, but the result always remains very pixelated and low quality.

Thank you,
Wout

Attachment: fig.pdf
Description: Adobe PDF document

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

Reply via email to