0

I have a dataframe, df, in which I created a line graph. I wish to stye it with dots within the line graph.

Sample dataset:

Size       Date         POD

0.027289      11/1/2020     SJ 
0.013563      11/1/2020     SJ 
0.058498      11/1/2020     SJ 
0.281953      11/1/2020     SJ
0.479725      11/1/2020     SJ 
0.007358      11/1/2020     SJ 
0.075818      11/1/2020     SJ
0.069744      11/1/2020     SJ 

This is what I am doing

 import plotly.express as px
 import plotly.graph_objects as go
 fig = px.line(df1, x = "Date", y = "Size", color = "POD", title = "POD Growth in US", labels = 
 {"Size": "Size in TB"})
 fig.update_layout(
 font_family="Arial",
 font_color="black",
 title_font_family="Arial",
 title_font_color="black",
 legend_title_font_color="black"
  )
 fig.update_xaxes(title_font_family="Arial")
fig.update_layout(
title={
    'text': "POD Growth in US",
    'y':0.9,
    'x':0.5,
    'xanchor': 'center',
    'yanchor': 'top'})


fig.show()

enter image description here

enter image description here enter image description here

Desired Result is to have dots

Lynn
  • 4,292
  • 5
  • 21
  • 44
  • yes @vestland it does. Thank you – Lynn Nov 04 '20 at 22:24
  • 1
    @Lynnette Ok,cool! And you probably know this, but don't feel like you should delete your question just because it has been flagged as a duplicate. Different users phrase their searches very differently, so *your* question may prove just as useful to future readers as the question in the link does. – vestland Nov 04 '20 at 22:37

1 Answers1

2

Use mode='lines+markers'. I am not sure it works with line method and px, as I would normally use

fig = go.Figure()
fig.add_trace(go.Scatter(
    x = df1["Date"], y = df1["Size"], mode='lines+markers'))
piterbarg
  • 8,089
  • 2
  • 6
  • 22