python - plotly - changing the line styles -
i trying plot multiple yet related things on plotly graph.
i want differentiate , relate lines @ same time. make myself more clearer, plotting roc characteristics of classifiers trained. want particular classifier of same color different line styles method of training.
here code same,
data = [ go.scatter( mode='lines+markers', x=df_logisticregression['fpr'], # assign x dataframe column 'x' y=df_logisticregression['tpr'], name = "logistic regression attributes", marker=dict( color="blue", symbol='square' ), ), # , on other algos go.scatter( mode='lines+markers', x=df_logisticregression_nonsp['fpr'], # assign x dataframe column 'x' y=df_logisticregression_nonsp['tpr'], name = "logistic regression non-sparse attributes", marker=dict( color="blue", symbol='square-open' ), ), # , on other algos ] layout = go.layout( title='roc curve', yaxis=dict(title='true positive rates(tpr)'), xaxis=dict(title='false positive rates(fpr)') ) fig = go.figure(data=data,layout=layout) iplot(fig) for instance, looking have color of logistic regression blue, 1 "all attributes should solid line , 1 "non-sparse attributes" should broken lines.
i tried , read documentation plotly not find help.
it because plotly, plots data based on mode ask do. if mode=markers going plot markers. if mode=lines going join points in data , plot lines.
please see page https://plot.ly/python/line-and-scatter/#line-and-scatter-plots more examples of lines can plotted using plotly.

Comments
Post a Comment