Why my lineplot doesn't begin with barplot? When I put only lineplot with ax2.set_xticklabels I got UserWarning: FixedFormatter should only be used together with FixedLocator. How to deal with this?
[ax1, ax2] = plt.subplots(figsize=(10, 7))
x = Melbourne2010['Month']
ax1 = sns.barplot(x = x, y = "Rainfall", data = Melbourne2010,
estimator = sum, #moze mean
ci = None,
color = 'Blue')
ax1.tick_params(axis='y', labelcolor='Blue')
ax1.set_title('Climate graph for Melbourne in 2010', fontsize = 20)
ax1.set_ylabel('Totall R (mm)', color = 'Blue', fontsize = 13)
ax1.set_xlabel('Month', fontsize = 13)
ax1.set_xticklabels(('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec'))
ax1.grid(None)
ax2 = ax1.twinx()
ax2 = sns.lineplot(x = x, y = "MaxTemp", data = Melbourne2010,
ci = None,
color = "red")
ax2.tick_params(axis = 'y', labelcolor = 'red')
ax2.set_ylabel("Maximum Temperature (0C)", color = 'red', fontsize = 13)
ax2 = plt.gca()
ax2.set_ylim([0, 50])
ax2.grid(None)
plt.show()