背景: mplfinance 包 从 Matplotlib 中分离,需单独install;
使用条件:
- python3; 2. anaconda; 3. bash 解释器;
步骤:
-
打开 terminal, pip install --upgrade mplfinance;
bash.png 成功安装之后 Spyder 不再提示 更新 mplfinance 包,绘制股票图;
import mplfinance as mpf
mpf.plot(data, type = 'candlestick') # data : df 对象
由于 mac当前 默认解释器 为 zsh, 以及本人未 在 zsh里配置 python3 和 anaconda 环境,遂将解释器更改为 bash, 完成更新操作;
run chsh -s /bin/bash 实现解释器切换;
From 量化小白