0

I am trying to make a simple line plot using plotly express, of a data frame:

diccionary = {'Bet_type': ['dozen', 'column', 'even_odd', 'red_black'],
              'Max_money': [216, 329, 377,193],
              'times_played':[51,83,594,202]}
df = pd.DataFrame(diccionary)
df 

when I try to plot all the Bet_type in a single graph, the graph appears with correct names but no lines

fig = px.line(df, x="times_played", y="Max_money", color ='Bet_type')
fig.show()

If I remove color it works but plots something that I am not interested in, In the same notebook I've made a similar plot with a different data frame and it works perfectly, so I assume doesn't have to do with the libraries. If someone have any idea why is this happening would be really appreciated. thanks

  • is this complete data you are trying to plot with? Line chart need continues data for both x and y. Adding color in plot is just giving categorical variable. without color also your plot does not make any sense on this data, does it? – jgrt Oct 28 '20 at 10:44
  • you are right it is because the data is not continuous haha thanks a lot!! – alejandro maza villalpando Oct 29 '20 at 10:53

0 Answers0