37,744
社区成员




import plotly as py
import plotly.graph_objs as go
pyplt = py.offline.plot
trace0 = go.Scatter(
x=[1991, 1992, 1993, 1994, 1995, 1996, 1997],
y=['US','US','US','US','US','US','US'],
mode='markers',
marker=dict(
color='rgb(150,204,90)',
size=[10, 14, 16, 18, 20, 42, 64],
showscale=False,
)
)
trace1 = go.Scatter(
x=[1991, 1992, 1993, 1994, 1995, 1996, 1997],
y=['JAPAN','JAPAN','JAPAN','JAPAN','JAPAN','JAPAN','JAPAN'],
mode='markers',
marker=dict(
color = 'rgb(200,150,100)',
size=[100, 30, 70, 85, 30, 42, 64],
showscale = False,
)
)
layout = go.Layout(
title="output of grapes per year in US and Japan",
xaxis=dict(
showgrid=True,
showline=True,
linecolor='rgb(102,102,102)',
titlefont=dict(
color='rgb(204,204,204)',
),
tickfont=dict(
color='rgb(102,102,102)',
),
dtick=1,
ticks='outside',
tickcolor='rgb(102,102,102)',
),
margin=dict(
l=140,
r=40,
b=50,
t=80,
),
legend=dict(
font=dict(
size=10,
),
yanchor='middle',
xanchor='right',
),
width=800,
height=600,
paper_bgcolor='rgb(254,247,234)',
plot_bgcolor='rgb(254,247,234)',
hovermode='closest',
)
data=[trace0, trace1, layout]
pyplt(data, filename='test.html')