首页 > 解决方案 > 为 scatter 的“fillcolor”属性接收到的“builtins.bool”类型的无效值

问题描述

我正在尝试在 python 3.6 中使用 quantmod 和 plotly 创建股票价值的财务图表。我基本上已经从 https://github.com/jackluo/py-quantmod/blob/master/start_here.ipynb 复制了示例代码。这是抛出一个错误。这是我的代码:

import pandas as pd
pd.core.common.is_list_like = pd.api.types.is_list_like
import plotly.graph_objs as go
from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot
init_notebook_mode(connected=True)
from plotly import tools
from datetime import datetime
from dateutil import parser
import quantmod as qm
import talib as ta

df = pd.read_csv('es-sample.csv', index_col=0)
df.columns = [c.strip() for c in df.columns]

ch = qm.Chart(df)

ch.add_RSI(14)
ch.plot()

这是显示的错误:

ValueError: 
    Invalid value of type 'builtins.bool' received for the 'fillcolor' property of scatter
        Received value: False

    The 'fillcolor' property is a color and may be specified as:
      - A hex string (e.g. '#ff0000')
      - An rgb/rgba string (e.g. 'rgb(255,0,0)')
      - An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
      - An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
      - A named CSS color:
            aliceblue, antiquewhite, aqua, aquamarine, azure,
            beige, bisque, black, blanchedalmond, blue,
            blueviolet, brown, burlywood, cadetblue,

我不知道该怎么做才能解决这个问题。

标签: python-3.xplotlyquantmod

解决方案


推荐阅读