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

Answer by boblatouffe for Wrapping long y labels in matplotlib tight layout...

If you are looking for a fast way to wrap your labels dynamically, you can simply replace '' by '\n' like this :wrapped_labels = [ label.replace('', '\n') for label in labels ]

View Article


Image may be NSFW.
Clik here to view.

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

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...

View Article


Image may be NSFW.
Clik here to view.

Wrapping long y labels in matplotlib tight layout using setp

I've been trying to wrap text for long labels in my code. I tried the textwrap method suggested earlier here, but my code defines yticklabels through an array imported from a csv using the...

View Article
Browsing all 3 articles
Browse latest View live


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