Visualization (AEN 4.1.0)
=========================

.. raw:: html

    <div class="section" id="plotting">
    <h2>Plotting<a class="headerlink" href="#plotting" title="Permalink to this headline">¶</a></h2>
    <p>Anaconda Enterprise Notebooks supports multiple visualization
    packages for Python and R language.</p>
    <p>For Python the default environment has Matplotlib and Bokeh already
    installed.</p>
    <p>For R language the default environment has r-ggplot2 and r-bokeh already
    installed.</p>
    </div>
    <div class="section" id="matplotlib">
    <h2>Matplotlib<a class="headerlink" href="#matplotlib" title="Permalink to this headline">¶</a></h2>
    <p><a class="reference external" href="http://matplotlib.org/">Matplotlib</a> is a Python 2D and 3D plotting and
    visualization library that produces publication-quality figures in a variety of
    hardcopy formats and interactive environments across platforms.</p>
    <p>In a notebook running the default environment Matplotlib figures can be
    displayed in the output cells by executing the following code.</p>
    <div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">matplotlib.pyplot</span> <span class="k">as</span> <span class="nn">plt</span>
    <span class="o">%</span><span class="n">matplotlib</span> <span class="n">inline</span>
    </pre></div>
    </div>
    <p>For example, here&#8217;s screen shot of a cumulative density function (CDF) plot
    of values taken from a normal distribution.</p>
    <p><img alt="mplCDF" src="../../../_images/ae-notebooks/4.1.0/user/visualization_mpl.png" /></p>
    <p>You can find a <a class="reference external" href="http://matplotlib.org/gallery.html">gallery</a>,
    <a class="reference external" href="http://matplotlib.org/examples/index.html">examples</a>,
    <a class="reference external" href="http://matplotlib.org/contents.html">documentation</a>, and a <a class="reference external" href="http://matplotlib.org/api/pyplot_summary.html">list of
    plotting commands</a> on
    the <a class="reference external" href="http://matplotlib.org/">matplotlib website</a>.</p>
    </div>
    <div class="section" id="bokeh">
    <h2>Bokeh<a class="headerlink" href="#bokeh" title="Permalink to this headline">¶</a></h2>
    <p><a class="reference external" href="http://bokeh.pydata.org/">Bokeh</a> is an interactive visualization
    library that targets modern web browsers to provide elegant, concise
    construction of novel graphics.</p>
    <p>In a notebook running the default environment, Bokeh figures can be
    displayed in the output cells by executing the following code.</p>
    <div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">bokeh.io</span> <span class="k">import</span> <span class="n">output_notebook</span><span class="p">,</span> <span class="n">show</span>
    <span class="n">output_notebook</span><span class="p">()</span>
    </pre></div>
    </div>
    <p>Here&#8217;s a screen shot of a scatter plot of of miles-per-gallon vs.
    horsepower for 392 automobiles using the autompg sample dataset.</p>
    <p><img alt="bokehMPG" src="../../../_images/ae-notebooks/4.1.0/user/visualization_bokehMPG.png" /></p>
    </div>
    <div class="section" id="ggplot">
    <h2>ggplot<a class="headerlink" href="#ggplot" title="Permalink to this headline">¶</a></h2>
    <p><a class="reference external" href="http://ggplot2.org/">ggplot2</a> is a plotting system for R language,
    based on the grammar of graphics, which tries to take the good parts
    of base and lattice graphics and none of the bad parts.</p>
    <p>To use ggplot2 with Anaconda Enterprise Notebooks open a new notebook
    using the R kernel. You can then load the ggplot2 library with the following
    code.</p>
    <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">library</span><span class="p">(</span><span class="n">ggplot2</span><span class="p">)</span>
    </pre></div>
    </div>
    <p>Here&#8217;s a screen shot of a scatter plot of sepal width vs sepal length
    using the iris dataset provided by the dplyr library.</p>
    <p><img alt="ggplot" src="../../../_images/ae-notebooks/4.1.0/user/visualization_ggplot.png" /></p>
    </div>
