Home > Net >  Matplotlib CSV x-ticks overlap
Matplotlib CSV x-ticks overlap

Time:10-08

So I have this dataset of regional temperatures.

It has daily data from many years, (for example 1998-7-12, 2005-4-12) so when I graph it with x as time, the x-lables overlap, and if I rotate them they still overlap.

my code looks like this:

import matplotlib.pyplot as plt
import pandas as pd

sheet = pd.read_csv('sheet.csv')

x = sheet['T']
y = sheet['F']
yerror = sheet['E']

plt.title('BHF')
plt.errorbar(x,y,yerr=yerror, fmt='o', elinewidth=1)
plt.grid(linestyle=':')

plt.show()

It looks like this: enter image description here

  • Related