I’m plotting lines from variable data, the items can sometimes have identical data points so need a way to figure out which lines are stacked on top of each other.
Ideas I’ve searched for include highlighting the lines when you hover the legend or a feature similar to Seaborn dodge & jitter, dodge actually works quite well, I just ended up using Plotly because it has has some nice defaults which save time like hover annotations and show/hide strips by clicking the corresponding legend item.
The bottom line in the following screenshot has all of the items stacked except the top two. I can click through the legend until I’ve removed the top two to know which ones are stacked but it’s not very efficient.
The code currently looks like this:
df = pd.DataFrame(pandas_dict_for_dataframe)
dfm = df.melt('Date', var_name='Item', value_name='Price')
fig = px.line(dfm, x="Date", y="Price", color='Item', markers=True)
fig.update_xaxes(type='category')
fig.show()