Phlya / adjustText

A small library for automatically adjustment of text position in matplotlib plots to minimize overlaps.
https://adjusttext.readthedocs.io/
MIT License
1.49k stars 87 forks source link

Does not seem to work with polar plots #106

Open ed5464215 opened 4 years ago

ed5464215 commented 4 years ago

This module does not seem to work with polar plots, ie.

ax = plt.subplot(111, projection='polar')

Getting a lot of errors like this when calling adjust_text:

posx and posy should be finite values

Phlya commented 4 years ago

How exactly are you running it, and which version are you using?

ed5464215 commented 4 years ago

I'm using version 0.7.3 on Win10/Python 3.7.9

Code looks like this:

def plot()
    texts+=[ax.text(theta, r, name)]
    x.append(theta)
    y.append(r)

adjust_text(texts, x, y, ax=ax)

texts array looks like this:

[Text(0.05715958439863086, 187.4845909654667, '20'), Text(6.291530381946766, 185.78712870108785, '21'), Text(0.916860540984257, 184.7031924247027, '15')]

Phlya commented 4 years ago

I see, can you try installing the version from GitHub: pip install https://github.com/Phlya/adjustText/archive/master.zip

ed5464215 commented 4 years ago

OK I installed 0.8b2 and am not getting the

posx and posy should be finite values

but it's not plotting any text.