You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
<divid="unreleased-message"> You are reading an old version of the documentation (v1.4.0). For the latest version see <ahref="/stable/">https://matplotlib.org/stable/</a></div>
<spanid="matplotlib-finance"></span><h2><aclass="reference internal" href="#module-matplotlib.finance" title="matplotlib.finance"><ttclass="xref py py-mod docutils literal"><spanclass="pre">matplotlib.finance</span></tt></a><aclass="headerlink" href="#module-matplotlib.finance" title="Permalink to this headline">¶</a></h2>
<p>A collection of functions for collecting, analyzing and plotting
financial data. User contributions welcome!</p>
<p>This module is deprecated in 1.4 and will be moved to <ttclass="xref py py-obj docutils literal"><spanclass="pre">mpl_toolkits</span></tt>
or it’s own project in the future.</p>
<dlclass="function">
<dtid="matplotlib.finance.candlestick">
<ttclass="descclassname">matplotlib.finance.</tt><ttclass="descname">candlestick</tt><spanclass="sig-paren">(</span><em>ax</em>, <em>quotes</em>, <em>width=0.2</em>, <em>colorup=u'k'</em>, <em>colordown=u'r'</em>, <em>alpha=1.0</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.finance.candlestick" title="Permalink to this definition">¶</a></dt>
<dd><p>Plot the time, open, close, high, low as a vertical line ranging
from low to high. Use a rectangular bar to represent the
open-close span. If close >= open, use colorup to color the bar,
otherwise use colordown</p>
<p>This function has been deprecated in 1.4 in favor of
<aclass="reference internal" href="#matplotlib.finance.candlestick_ochl" title="matplotlib.finance.candlestick_ochl"><ttclass="xref py py-obj docutils literal"><spanclass="pre">candlestick_ochl</span></tt></a>, which maintains the original argument
order, or <aclass="reference internal" href="#matplotlib.finance.candlestick_ohlc" title="matplotlib.finance.candlestick_ohlc"><ttclass="xref py py-obj docutils literal"><spanclass="pre">candlestick_ohlc</span></tt></a>, which uses the
open-high-low-close order. This function will be removed in 1.5</p>
<div><p>returns (lines, patches) where lines is a list of lines
added and patches is a list of the rectangle patches added</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.finance.candlestick2">
<ttclass="descclassname">matplotlib.finance.</tt><ttclass="descname">candlestick2</tt><spanclass="sig-paren">(</span><em>ax</em>, <em>opens</em>, <em>closes</em>, <em>highs</em>, <em>lows</em>, <em>width=4</em>, <em>colorup=u'k'</em>, <em>colordown=u'r'</em>, <em>alpha=0.75</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.finance.candlestick2" title="Permalink to this definition">¶</a></dt>
<dd><p>Represent the open, close as a bar line and high low range as a
vertical line.</p>
<p>This function has been deprecated in 1.4 in favor of
<aclass="reference internal" href="#matplotlib.finance.candlestick2_ochl" title="matplotlib.finance.candlestick2_ochl"><ttclass="xref py py-obj docutils literal"><spanclass="pre">candlestick2_ochl</span></tt></a>, which maintains the original argument order,
or <aclass="reference internal" href="#matplotlib.finance.candlestick2_ohlc" title="matplotlib.finance.candlestick2_ohlc"><ttclass="xref py py-obj docutils literal"><spanclass="pre">candlestick2_ohlc</span></tt></a>, which uses the open-high-low-close order.
<ttclass="descclassname">matplotlib.finance.</tt><ttclass="descname">fetch_historical_yahoo</tt><spanclass="sig-paren">(</span><em>ticker</em>, <em>date1</em>, <em>date2</em>, <em>cachename=None</em>, <em>dividends=False</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.finance.fetch_historical_yahoo" title="Permalink to this definition">¶</a></dt>
<dd><p>Fetch historical data for ticker between date1 and date2. date1 and
date2 are date or datetime instances, or (year, month, day) sequences.</p>
<ttclass="descclassname">matplotlib.finance.</tt><ttclass="descname">parse_yahoo_historical</tt><spanclass="sig-paren">(</span><em>fh</em>, <em>adjusted=True</em>, <em>asobject=False</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.finance.parse_yahoo_historical" title="Permalink to this definition">¶</a></dt>
<dd><p>Parse the historical data in file handle fh from yahoo finance.</p>
<p>This function has been deprecated in 1.4 in favor of
<aclass="reference internal" href="#matplotlib.finance.parse_yahoo_historical_ochl" title="matplotlib.finance.parse_yahoo_historical_ochl"><ttclass="xref py py-obj docutils literal"><spanclass="pre">parse_yahoo_historical_ochl</span></tt></a>, which maintains the original argument
order, or <aclass="reference internal" href="#matplotlib.finance.parse_yahoo_historical_ohlc" title="matplotlib.finance.parse_yahoo_historical_ohlc"><ttclass="xref py py-obj docutils literal"><spanclass="pre">parse_yahoo_historical_ohlc</span></tt></a>, which uses the
open-high-low-close order. This function will be removed in 1.5</p>
<ttclass="descclassname">matplotlib.finance.</tt><ttclass="descname">parse_yahoo_historical_ochl</tt><spanclass="sig-paren">(</span><em>fh</em>, <em>adjusted=True</em>, <em>asobject=False</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.finance.parse_yahoo_historical_ochl" title="Permalink to this definition">¶</a></dt>
<dd><p>Parse the historical data in file handle fh from yahoo finance.</p>
<ttclass="descclassname">matplotlib.finance.</tt><ttclass="descname">parse_yahoo_historical_ohlc</tt><spanclass="sig-paren">(</span><em>fh</em>, <em>adjusted=True</em>, <em>asobject=False</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.finance.parse_yahoo_historical_ohlc" title="Permalink to this definition">¶</a></dt>
<dd><p>Parse the historical data in file handle fh from yahoo finance.</p>
<p>where d is a floating poing representation of date,
as returned by date2num, and date is a python standard
library datetime.date instance.</p>
<p>The name of this kwarg is a historical artifact. Formerly,
True returned a cbook Bunch
holding 1-D ndarrays. The behavior of a numpy recarray is
very similar to the Bunch.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.finance.plot_day_summary">
<ttclass="descclassname">matplotlib.finance.</tt><ttclass="descname">plot_day_summary</tt><spanclass="sig-paren">(</span><em>ax</em>, <em>quotes</em>, <em>ticksize=3</em>, <em>colorup=u'k'</em>, <em>colordown=u'r'</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.finance.plot_day_summary" title="Permalink to this definition">¶</a></dt>
<dd><p>Plots day summary</p>
<blockquote>
<div>Represent the time, open, close, high, low as a vertical line
ranging from low to high. The left tick is the open and the right
tick is the close.</div></blockquote>
<p>This function has been deprecated in 1.4 in favor of
<ttclass="xref py py-obj docutils literal"><spanclass="pre">plot_day_summary_ochl</span></tt>, which maintains the original argument
order, or <aclass="reference internal" href="#matplotlib.finance.plot_day_summary_ohlc" title="matplotlib.finance.plot_day_summary_ohlc"><ttclass="xref py py-obj docutils literal"><spanclass="pre">plot_day_summary_ohlc</span></tt></a>, which uses the
open-high-low-close order. This function will be removed in 1.5</p>
<div><p>list of tuples of the lines added (one tuple per quote)</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.finance.plot_day_summary2">
<ttclass="descclassname">matplotlib.finance.</tt><ttclass="descname">plot_day_summary2</tt><spanclass="sig-paren">(</span><em>ax</em>, <em>opens</em>, <em>closes</em>, <em>highs</em>, <em>lows</em>, <em>ticksize=4</em>, <em>colorup=u'k'</em>, <em>colordown=u'r'</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.finance.plot_day_summary2" title="Permalink to this definition">¶</a></dt>
<dd><p>Represent the time, open, close, high, low, as a vertical line
ranging from low to high. The left tick is the open and the right
tick is the close.</p>
<p>This function has been deprecated in 1.4 in favor of
<aclass="reference internal" href="#matplotlib.finance.plot_day_summary2_ochl" title="matplotlib.finance.plot_day_summary2_ochl"><ttclass="xref py py-obj docutils literal"><spanclass="pre">plot_day_summary2_ochl</span></tt></a>, which maintains the original argument
order, or <aclass="reference internal" href="#matplotlib.finance.plot_day_summary2_ohlc" title="matplotlib.finance.plot_day_summary2_ohlc"><ttclass="xref py py-obj docutils literal"><spanclass="pre">plot_day_summary2_ohlc</span></tt></a>, which uses the
open-high-low-close order. This function will be removed in 1.5</p>
<ttclass="descclassname">matplotlib.finance.</tt><ttclass="descname">plot_day_summary_oclh</tt><spanclass="sig-paren">(</span><em>ax</em>, <em>quotes</em>, <em>ticksize=3</em>, <em>colorup=u'k'</em>, <em>colordown=u'r'</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.finance.plot_day_summary_oclh" title="Permalink to this definition">¶</a></dt>
<dd><p>Plots day summary</p>
<blockquote>
<div>Represent the time, open, close, high, low as a vertical line
ranging from low to high. The left tick is the open and the right
<div><p>list of tuples of the lines added (one tuple per quote)</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.finance.plot_day_summary_ohlc">
<ttclass="descclassname">matplotlib.finance.</tt><ttclass="descname">plot_day_summary_ohlc</tt><spanclass="sig-paren">(</span><em>ax</em>, <em>quotes</em>, <em>ticksize=3</em>, <em>colorup=u'k'</em>, <em>colordown=u'r'</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.finance.plot_day_summary_ohlc" title="Permalink to this definition">¶</a></dt>
<dd><p>Plots day summary</p>
<blockquote>
<div>Represent the time, open, high, low, close as a vertical line
ranging from low to high. The left tick is the open and the right