-1
我正嘗試在一個密謀圖上繪製多個相關事物。- 更改線條樣式
我想同時區分和關聯這些行。爲了讓自己更清晰,我正在繪製我訓練的分類器的ROC特徵。我想要一種具有相同顏色但不同線條樣式的特定分類器用於訓練方法。
下面是相同的代碼,
data = [
go.Scatter(
mode='lines+markers',
x=df_LogisticRegression['FPR'], # assign x as the dataframe column 'x'
y=df_LogisticRegression['TPR'],
name = "Logistic Regression all attributes",
marker=dict(
color="blue",
symbol='square'
),
),
# and so on for all other algos
go.Scatter(
mode='lines+markers',
x=df_LogisticRegression_nonSP['FPR'], # assign x as the dataframe column 'x'
y=df_LogisticRegression_nonSP['TPR'],
name = "Logistic Regression non-sparse attributes",
marker=dict(
color="blue",
symbol='square-open'
),
),
# and so on for all 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)
例如, 我期待有迴歸爲藍色的顏色,但「所有屬性應爲實線,具有」非稀疏屬性「的屬性應爲虛線。
我試圖查閱並讀取文檔在情節上,但找不到任何幫助。
當您在模式中編寫「線條」時,即使點很稀疏,它也會繪製線條。它會加入點。 –
只需嘗試'mode = markers'爲非稀疏數據集 –
我需要一條線,我可以不以任何方式更改線條樣式嗎?我正在看[Plotly shapes](https://plot.ly/python/shapes/)和第一個例子,是否有類似的東西可以實現? –