plotly.express 非常方便地生成漂亮的交互式绘图。下面的代码生成一个按国家/地区着色的折线图。现在我需要的是在图中添加点。有谁知道如何向折线图添加点?
import plotly.express as px
gapminder = px.data.gapminder().query("continent=='Oceania'")
fig = px.line(gapminder, x="year", y="lifeExp", color='country')
fig.show()
Run Code Online (Sandbox Code Playgroud) Plotly 有没有办法访问其范围内任何值的颜色图颜色?
我知道我可以从
plotly.colors.PLOTLY_SCALES["Viridis"]
Run Code Online (Sandbox Code Playgroud)
但我无法找到如何访问中间/插值。
此问题中显示了 Matplotlib 中的等效项。还有另一个问题解决了colorlover图书馆的类似问题,但都没有提供很好的解决方案。