Search code examples
pythonmatplotlibaxes

Rotate the ticklabels while keeping the letter horizontal


When I use ax.set_xticklabels(['somethinghere']*10, rotation='-90'), I get a result like this:

rotated word

I want to just rotate the words while keeping the letters horizontal. What I expected is something like this:

word going down

How can I get a x axis label with the word going down instead of a rotated word?


Solution

  • Maybe not the best way but certainly works

    ax.set_xticklabels((['s\n''o\n''m\n''e\n''t\n''h\n''i\n''n\n''g\n' ])*10)