擅长:python、mysql、java
<p>使用<a href="https://matplotlib.org/api/_as_gen/matplotlib.pyplot.gca.html?highlight=gca#matplotlib.pyplot.gca" rel="noreferrer">^{<cd1>}</a>(“获取当前轴”)帮助函数:</p>
<pre><code>ax = plt.gca()
</code></pre>
<p>示例:</p>
<pre><code>import matplotlib.pyplot as plt
import matplotlib.finance
quotes = [(1, 5, 6, 7, 4), (2, 6, 9, 9, 6), (3, 9, 8, 10, 8), (4, 8, 8, 9, 8), (5, 8, 11, 13, 7)]
ax = plt.gca()
h = matplotlib.finance.candlestick(ax, quotes)
plt.show()
</code></pre>
<p><img src="https://i.stack.imgur.com/uiWWL.png" alt="enter image description here"/></p>