Matplotlib: How to format float values for plt.xticks

  matplotlib, python, seaborn

I have a Seaborn boxplot with xticks that I am trying to format. Currently they look like the image below:

enter image description here

However, I want to have a tick at every 0.01 interval.

I tried plt.xticks(range(-0.3,0.3,0.01)), however I am getting an error that reads

‘float’ object cannot be interpreted as an integer

Which I believe is because I cannot use float values with range(). Any idea on how I can bypass this?

Source: Python Questions

LEAVE A COMMENT