Hi
I am trying to plot a grid on scatter. I tried all the way but it doesnโt work for me. Could you please help me here. Below is my code.
import pandas as pd
import plotly.express as px
import matplotlib.pyplot as plt
workflow_nm=['worklfow_1','worklfow_2','worklfow_3','worklfow_4','worklfow_5']
date=['2024-02-09','2024-02-02','2024-02-07','2024-02-13','2024-02-28']
time=['10:00:00','14:00:00','07:00:00','20:00:00','16:00:00']
final_dict = {'dag_id': workflow_nm, 'date': date, 'time': time}
df = pd.DataFrame(final_dict)
final_df = df.sort_values('time')
fig =px.scatter(final_df, x='date', y='time', color="dag_id")
#fig = px.strip(final_df, x='date', y='time', color="dag_id")
# Customization of y-axis
#fig.update_yaxes(range=[0, 10])
# Figure layout
fig.update_layout(template='simple_white', width=700, height=1000, title='Worfklow Schedule Visualization', yaxis_title='Schedule Time',
legend=dict(title='TagName', itemclick='toggle', itemsizing='constant', traceorder='normal',
bgcolor='rgba(0,0,0,0)', x=1),
xaxis=dict(title='Schedule Date', showticklabels=True, ticks='outside', type='category'))
fig.update_xaxes(griddash='solid')
# Make figure zoomable
config = dict({'scrollZoom': False})
fig.write_html("visual_dag.html")
fig.show(config=config)