0

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

Alex Waygood
  • 4,796
  • 3
  • 14
  • 41

1 Answers1

0

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()
Mohammad
  • 3,074
  • 2
  • 18
  • 32