Date and time gaps not being shown

I am having trouble with properly showing the gaps in my x-axis which is formatted to be date+time. There is a gap between March 10, 11:50 PM and March 12, 12:00 AM and the plot skips March 11th completely to go to the next data point on the 12th. Is there a way to display the gap between the 10th and 12th?

Thank you in advance!

Could you share the code used to create your plot? I don’t understand why a date x-axis should display like in your image

Hi David,

Here you go:

import pandas as pd
import plotly.express as px

Finds the file using the full address including “'/content/” in the beginning.

data =‘/content/drive/Shared drives/Aleezah - Ice Resilient Technology/06_Analysis/Pyton coding trial with water level data/Raw Text data files/Combined GNSSR Nevis Red Deer Feb 9 - March 20 2024 (data from David).csv’
df_gnssr = pd.read_csv(data, sep=‘,’) # Coverts the csv file into a table

data_2 =‘/content/drive/Shared drives/Aleezah - Ice Resilient Technology/06_Analysis/Pyton coding trial with water level data/Raw Text data files/Heading Adjusted for Feb - March 2024 data.csv’

df_laser = pd.read_csv(data_2, sep=‘,’) # Coverts the csv file into a table

#Creates interactive scatter plot
plot = px.scatter(df_gnssr, x=“TIMESTAMP TS”, y=“Vertical_Distance (m) Smp”)

plot.add_trace(px.scatter(df_gnssr, x=“time (UTC)”, y=“Water level (m)”))

Centers the title

plot.update_layout(title={‘text’: “Water Level (m) from Gnssr 2024”,‘y’:0.95,‘x’:0.5, ‘xanchor’: ‘center’,‘yanchor’: ‘top’})

customize the marker

plot.update_traces(marker_size=5, marker = dict(symbol=“diamond”, color=“lightskyblue”))

Showing Scatter Plot with Scroll Zoom.

plot.show(config={‘scrollZoom’: True} )

The comments didn’t translate properly but they are the bolded lines.

I’m guessing a but, but I wonder if your column “TIMESTAMP TS” is a string, or has at least some string entries.

You may need to convert it to pandas timestamps to use as the x-axis.

That was it! Thank you so much!