Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adjust_text doesn't appear to respect horizontal alignment #92

Closed
adrn opened this issue Apr 23, 2020 · 1 comment
Closed

adjust_text doesn't appear to respect horizontal alignment #92

adrn opened this issue Apr 23, 2020 · 1 comment

Comments

@adrn
Copy link

@adrn adrn commented Apr 23, 2020

Example taken from the documentation, adding ha='center' to plt.text() calls:

np.random.seed(0)
x, y = np.random.random((2,30))
fig, ax = plt.subplots()
plt.plot(x, y, 'bo')
texts = [plt.text(x[i], y[i], 'Text%s' %i, ha='center') for i in range(len(x))]

image
Text is horizontally centered properly.

Now run adjust_text:

fig, ax = plt.subplots()
plt.plot(x, y, 'bo')
texts = [plt.text(x[i], y[i], 'Text%s' %i, ha='center') for i in range(len(x))]
adjust_text(texts)

image

@Phlya
Copy link
Owner

@Phlya Phlya commented Apr 23, 2020

Please try using the ha argument of adjust_text and set autoalign to False or y.

@Phlya Phlya closed this Jun 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.