title: Pydot error with sklearn decision tree graph
body: <p>I am trying to use following code from sklearn (<a href="http://scikit-learn.org/stable/modules/tree.html" rel="nofollow">http://scikit-learn.org/stable/modules/tree.html</a>):</p>
  
  <pre><code>from sklearn.externals.six import StringIO
  import pydot 
  dot_data = StringIO()
  tree.export_graphviz(clf, out_file=dot_data)
  graph = pydot.graph_from_dot_data(dot_data.getvalue())
  graph.write_pdf("iris.pdf")
  </code></pre>
  
  <p>I have installed <code>pydot==1.0.2</code> and when I run this code using Ipython notebook, it gives following error. </p>
  
  <pre><code>InvocationException                       Traceback (most recent call last)
  &lt;ipython-input-22-18c25f6a061c&gt; in &lt;module&gt;()
    4 tree.export_graphviz(clf, out_file=dot_data)
    5 graph = pydot.graph_from_dot_data(dot_data.getvalue())
  ----&gt; 6 graph.write_pdf("iris.pdf")
  
   /Users/aj/anaconda/lib/python2.7/site-packages/pydot.pyc in &lt;lambda&gt;(path, f,     prog)
   1600             self.__setattr__(
   1601                 'write_'+frmt,
  -&gt; 1602                 lambda path, f=frmt, prog=self.prog : self.write(path,         format=f, prog=prog))
  1603 
  1604             f = self.__dict__['write_'+frmt]
  
  /Users/aj/anaconda/lib/python2.7/site-packages/pydot.pyc in write(self, path, prog, format)
  1694             dot_fd.write(self.to_string())
  1695         else:
  -&gt; 1696             dot_fd.write(self.create(prog, format))
   1697         dot_fd.close()
   1698 
  
   /Users/aj/anaconda/lib/python2.7/site-packages/pydot.pyc in create(self, prog,  format)
   1794             raise InvocationException(
   1795                 'Program terminated with status: %d. stderr follows: %s'  % (
   -&gt; 1796                     status, stderr_output) )
    1797         elif stderr_output:
    1798             print stderr_output
  
  InvocationException: Program terminated with status: 1. stderr follows: Format: "pdf" not recognized. Use one of
  </code></pre>
  
  <p>Regardless of the format that I changed it to, it gave the same error. I am running this on Mac OS X Yosemite. </p>
  
  <p>Any suggestion will be greatly appreciate. </p>