title: How to set significant figures in pyplot annotation
body: <p>P-values and D-Values from a K-S test need to be displayed on a pylot histogram.  Thankfully, my p-values are low, but are so low they display as <code>0.0</code> when I use <code>round</code>.  I also tried <code>numpy.set_printoptions(precision=3)</code> to limit my significant digits to the thousands place, but this only changed my output printing to the interpreter, and not to the graph.</p>
  
  <pre><code> ks_D, ks_p = ks_2samp(cntrl, test)
  
   ks_summ = "K-S D-value = {}\nK-S p-value = {}".format(round(ks_D, 3), round(ks_p, 3))
  pyplot.annotate(ks_summ, xy=(0.70, 0.75), xycoords='axes fraction')
  </code></pre>
  
  <p>So how can I display <code>1.2228387401e-24</code> (<code>&lt;class 'numpy.float64'&gt;</code>) as <code>1.223e-24</code> in a graph annotation?</p>
  
  <p>Here is my graph with p-value showing as 0.0:
  <a href="https://i.stack.imgur.com/fETht.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fETht.png" alt="enter image description here"></a></p>