Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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