HI ,
Do anyone have any idea why my x-axis will not display all the date in the x axis.
import pandas as pd
import matplotlib.pyplot as plt
# Read the Excel file into a pandas DataFrame
df = pd.read_excel('1.xlsx')
# Set the datettime column as the index
df.set_index('datetime', inplace=True)
# Plot a line graph
df.plot(kind='line')
# Add x-label, y-label, and title to the plot
plt.xlabel('Timesss')
plt.ylabel('Throughput')
plt.title('DL Throughput vs Time')
plt.xticks(rotation=90)
# Display the plot
plt.show()
output:
my excel file as below:
!
I went and search some people mention using below method, but after using below will cause all the time to squeeze together
plt.xticks(df['datetime'], rotation=90)
DO anyone know how to show like excel line chart?