I have an data on excel . enter image description here . I filtered some columns and rows from this excel file and wrote this code ;
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
df=pd.read_excel("Julian_iski_data_python.xlsx")
df = df[["prSM [db]", "year", "T(degC)","Station"]]
df = df.loc[df["prSM [db]"] == 1]
df = df.loc[df["Station"].isin(["M8", "M14", "M23", "MY2"])]
fig = plt.figure(figsize=(10,10))
axes = fig.add_axes([0.04,0.06,0.95,0.91])
sns.scatterplot(data=df, x="year", y="T(degC)", hue="Station",style="Station")
sns.lineplot(data=df, x="year", y="T(degC)", hue="Station",style="Station")
axes.xaxis.set_major_locator(mdates.YearLocator(1))
axes.set_xlabel("Time")
axes.grid()
plt.show()
And ı got this graph. enter image description here . My question is :
In the graph, I got the x-axis from the column named "year" . and ı also have new_year column. enter image description here . If the year values in the column named "new year" match the "year" on the x-axis of the graph, I want to put a grid there. How can ı do this ?
If I didn't explain myself well, I would like to explain it with a photo.enter image description here