import plotly.offline as py
from plotly.graph_objs import Scatter, Layout
import plotly.graph_objs as go
py.init_notebook_mode(connected=True)
trace=go.Scatter(
x=[1,2,3],
y=[1,2,3],
marker=dict(
color=['red','blue','green'],
size=[30,80,10],
),
mode='markers'
)
py.iplot([trace])
我想实现y>2时,color为red;y<2时,color为blue;
还请大神指教,在此谢过。