2

Is there a way to automatically reduce the length of string in matplotlib if it conflicts with neighboring texts such as in: enter image description here

What I'm looking for is if matplotlib detects a conflict with another text, it automatically reduce the texts in order for all the texts to be readable.

Note that one could of course rotate the labels or make the fontsize smaller to prevent overlap. But here I'm asking how to cut the text in case of overlap.

ImportanceOfBeingErnest
  • 321,279
  • 53
  • 665
  • 712
Victor
  • 360
  • 3
  • 16
  • 1
    Matplotlib doesn't detect such conflict; you will need to do it yourself. As a start one can look at [this answer](http://stackoverflow.com/a/10739207/854988). Or check https://github.com/Phlya/adjustText/blob/master/adjustText/__init__.py – ImportanceOfBeingErnest Sep 06 '19 at 15:32

0 Answers0