Answers.Body: <p>It looks like <code>rdkit</code> and <code>rdkit</code>'s <code>Chem</code> just use the <code>matplotlib</code>. So, if you import <code>matplotlib</code> you can edit your figure like any other <code>matplotlib</code> figure.</p>
  
  <p>I produced this from the command line, so it may work differently in the Jupyter environment.</p>
  
  <p>It looks like <code>Chem</code> doesn't properly scale the drawing based on how large the chemical is, so I added <code>plt.xlim</code> and <code>plt.ylim</code> to make the molecule larger in the frame.</p>
  
  <pre class="lang-python prettyprint-override"><code>from rdkit import Chem
  from rdkit.Chem import Draw
  import matplotlib.pyplot as plt
  smiles = 'CCC'
  m = Chem.MolFromSmiles(smiles)
  fig = Draw.MolToMPL(m)
  plt.title('Test')
  plt.axis('off')
  coord_min = 0.35
  coord_max = 0.65
  plt.xlim((coord_min, coord_max))
  plt.ylim((coord_min, coord_max))
  fig.savefig('mol.jpeg', bbox_inches='tight')
  </code></pre>
  
  <p><a href="https://i.sstatic.net/RBrb2.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/RBrb2.jpg" alt="enter image description here"></a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-10T00:27:31.380Z
Answers.LastActivityDate: 2018-12-10T00:34:44.660Z
Answers.LastEditDate: 2018-12-10T00:34:44.660Z
Answers.UserDisplayName: conchoecia
Body: <p>RDKit can plot molecules, thought the structures are surrounded by an ugly frame with ticks. How can I turn that off and plot the molecules without that frame?</p>
  
  <p>Note, the <code>%pylab inline</code> portion of this code is from the Jupyter environment.</p>
  
  <pre><code>%pylab inline
  from rdkit import Chem
  from rdkit.Chem import Draw
  
  smiles = 'CCC'
  m = Chem.MolFromSmiles(smiles)
  fig = Draw.MolToMPL(m)
  title('Test')
  </code></pre>
  
  <p><a href="https://i.sstatic.net/gMDmg.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/gMDmg.jpg" alt="enter image description here"></a></p>
  
Tags: <python><visualization>
Title: How to remove frame on RDKit figures?
ThreadText: # How to remove frame on RDKit figures?
  
  (Asked by: username_0 on 2018-12-09)
  
  RDKit can plot molecules, thought the structures are surrounded by an ugly frame with ticks. How can I turn that off and plot the molecules without that frame?
  
  Note, the `%pylab inline` portion of this code is from the Jupyter environment.
  
  ```
  %pylab inline
  from rdkit import Chem
  from rdkit.Chem import Draw
  
  smiles = 'CCC'
  m = Chem.MolFromSmiles(smiles)
  fig = Draw.MolToMPL(m)
  title('Test')
  
  ```
  
  [![enter image description here](https://i.sstatic.net/gMDmg.jpg)](https://i.sstatic.net/gMDmg.jpg)
  
  **Tags:** python, visualization
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-12-10. Score: 2
  
  It looks like `rdkit` and `rdkit`'s `Chem` just use the `matplotlib`. So, if you import `matplotlib` you can edit your figure like any other `matplotlib` figure.
  
  I produced this from the command line, so it may work differently in the Jupyter environment.
  
  It looks like `Chem` doesn't properly scale the drawing based on how large the chemical is, so I added `plt.xlim` and `plt.ylim` to make the molecule larger in the frame.
  
  ```python
  from rdkit import Chem
  from rdkit.Chem import Draw
  import matplotlib.pyplot as plt
  smiles = 'CCC'
  m = Chem.MolFromSmiles(smiles)
  fig = Draw.MolToMPL(m)
  plt.title('Test')
  plt.axis('off')
  coord_min = 0.35
  coord_max = 0.65
  plt.xlim((coord_min, coord_max))
  plt.ylim((coord_min, coord_max))
  fig.savefig('mol.jpeg', bbox_inches='tight')
  
  ```
  
  [![enter image description here](https://i.sstatic.net/RBrb2.jpg)](https://i.sstatic.net/RBrb2.jpg)
  
  
  ---
  
  