consider the following code
import pandas as pd
import numpy as np
import plotly.express as px
df = pd.DataFrame(
{'val1':np.random.uniform(low=0.5, high=20, size=(50,)),
'val2': np.random.uniform(low=2.5, high=40, size=(50,)),
'val3': np.random.uniform(low=134.5, high=240, size=(50,)),
})
fig = px.scatter(df, x = 'val1', y = ['val3', 'val2'])
fig.show()
fig = px.scatter(df, x = 'val1', y = ['val1', 'val2'])
fig.show()
fig = px.scatter(df, x = 'val1', y = ['val1'])
fig.show()
fig = px.scatter(df, x = 'val1', y = 'val1')
fig.show()
The first figure shows as expected two traces. However, the second figures shows only val2. This seems to come from the presence of val1 in the list as figure three is empty. If it is not a list like in figure 4, then everything is fine. wtf?
Has anyone seen that and knows a solution? I want to use the list in a function which gets different y-axis values and sometimes the same as was used for the x-axis.
Plotly version is 5.9.0