Home > OS >  How do I label the x & y axis of multiple graphs on a single graph
How do I label the x & y axis of multiple graphs on a single graph

Time:09-26

I have this histograph that shows all my numerical variables. I want to add x and y labels to each of them. Is that possible or do i have to break them all up into tiny graphs

dfConverted[['attack', 'defense', 'link_number', 'pendulum_left', 'pendulum_right', 'stars']].hist(bins=50, figsize=(20,15))
plt.show()

resulting graph

CodePudding user response:

The hist method will return a list of axes that you can loop through and update.

axes = dfConverted[['attack', 'defense', 'link_number', 'pendulum_left', 'pendulum_right', 'stars']].hist(bins=50, figsize=(20,15)) 
for ax in axes[0]:
  ax.set_xlabel('x')
  ax.set_ylabel('y')
plt.show()
  • Related