dash problems - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: dash problems (/thread-10948.html) |
dash problems - zhujp98 - Jun-14-2018 I want to scatter plot campcnt vs cnt by year, but I get error msg. How to fix this problem? Thanks, Jeff print(df.head()) app = dash.Dash() app.layout = html.Div([ dcc.Graph( id='life-exp-vs-gdp', figure={ 'data': [ go.Scatter( x=df[df['year'] == i]['cntcamp'], y=df[df['year'] == i]['cnt'], mode='markers', opacity=0.7, marker={ 'size': 15, 'line': {'width': 0.5, 'color': 'white'} }, name=i ) for i in df.year.unique() ], 'layout': go.Layout( xaxis={'type': 'log', 'title': 'Camp Count'}, yaxis={'title': 'Total count'}, margin={'l': 40, 'b': 40, 't': 10, 'r': 10}, legend={'x': 0, 'y': 1}, hovermode='closest' ) } ) ])
|