I have a simple dataframe with the time as index and dummy values as example.
I did a simple scatter plot as you see here:
Simple question: How to adjust the xaxis
, so that all time values from 00:00 to 23:00 are visible in the xaxis
? The rest of the plot is fine, it shows all the datapoints, it is just the labeling. Tried different things but didn't work out.
All my code so far is:
import pandas as pd
import seaborn as sns
import matplotlib.dates as mdates
from datetime import time
data = []
for i in range(0, 24):
temp_list = []
temp_list.append(time(i))
temp_list.append(i)
data.append(temp_list)
my_df = pd.DataFrame(data, columns=["time", "values"])
my_df.set_index(['time'],inplace=True)
my_df
fig = sns.scatterplot(x=my_df.index, y=my_df['values'])
fig.set(xlabel='time', ylabel='values')