Seaborn
plt.xlabel()
Setting x labels and y labels. Even though, the plot is done as Seaborn, the x-label and y-label should be specified in the marplotlib function.
fig, axes = plt.subplots(nrows=5, ncols=2, figsize=(16,20))
num_graph = 10
id_per_graph = ceil(train_data.item_category_id.max() / num_graph)
plt.xlabel("xlabels")
plt.ylabel("ylabels")
count = 0
for i in range(5):
for j in range(2):
# train_data hasn't been grouped, but the train_data is being filtered to select certain range of iterm_category_id
# Seaborn lineplot gives average of the variable in the y-label
plot = sns.lineplot(x = 'month', y = 'item_cnt_day', hue = 'item_category_id', palette="twilight",
data = train_data[np.logical_and(count*id_per_graph <= train_data['item_category_id'], train_data['item_category_id'] < (count+1)*id_per_graph)],
ax = axes[i][j])
# err_style="bars" can be added at the last to sepcify error
plot.set_xlabel("Month")
plot.set_ylabel("Item Sold per Month")
count += 1
Leave a comment