Quantcast
Channel: Wrapping long y labels in matplotlib tight layout using setp - Stack Overflow
Viewing all articles
Browse latest Browse all 3

Answer by daedalus for Wrapping long y labels in matplotlib tight layout using setp

$
0
0

I have tried using textwrap on the labels and it works for me.

from textwrap import wraplabels=['Really really really really really really long label 1','Really really really really really really long label 2','Really really really really really really long label 3']labels = [ '\n'.join(wrap(l, 20)) for l in labels ]

Inserting this in your code gives us:

Wrapped labels


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>