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

Update __init__.py #147

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update __init__.py #147

wants to merge 1 commit into from

Conversation

olavl
Copy link

@olavl olavl commented Apr 19, 2023

This PR addresses issue #143, where adjustText does not properly position text labels when using the %matplotlib notebook backend in Jupyter Notebook.

The issue appears to be related to the calculation of bounding boxes for scatter plot elements in the get_bboxes_pathcollection function. By updating the canvas before calculating the bounding boxes (adding ax.figure.canvas.draw() at the beginning of the function), the issue is resolved, and adjustText works correctly with %matplotlib notebook.

The fix was suggested by ChatGPT, an AI language model by OpenAI.

@Phlya
Copy link
Owner

Phlya commented Apr 19, 2023

Thanks for the PR, why is it needed when this is done in the main function?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants