adjustText
adjustText copied to clipboard
Tries to make enormous image when passed annotations instead of texts
Hi again, quick bug report: when I pass adjust_text a list of annotations made with plot.annotate(), it tries to make an enormous image, over 900,000 pixels wide. When I switched to passing it a list of objects made with plot.text(), it worked. I think this is probably a bug, but I'm not sure. Thanks.
Hi again, this is not a bug, it's currently not intended to work with annotation objects, but would be great to make this possible. I don't have time to work on this now, but would be happy to consider a PR for this.
Okay, thanks. I probably don't have time to work on it either right now, but maybe someday... I'm pretty new to matplotlib, so could you describe briefly what the differences would be in handling annotation objects instead? How complex would it be to use them instead?
Should be quite similar, you just need to figure out how to get bbox of the text part of the annotation...
Ok, thanks. I might take a look at this again in a few weeks. :)
Shouldn't be too complex I guess... You just need to get bbox from the text of the annotation, not the whole annotation, I guess it should be possible somehow.
2016-10-22 5:15 GMT+01:00 alphapapa [email protected]:
Okay, thanks. I probably don't have time to work on it either right now, but maybe someday... I'm pretty new to matplotlib, so could you describe briefly what the differences would be in handling annotation objects instead? How complex would it be to use them instead?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Phlya/adjustText/issues/7#issuecomment-255506361, or mute the thread https://github.com/notifications/unsubscribe-auth/ACwsuty2qaKTnFnTIuqpwmQm0hyig-Wbks5q2Y39gaJpZM4KcgMx .
Is there already any RP for this feature request?
No, sorry... any particular reason you need to use annotations?
On Fri, 5 Oct 2018, 20:45 yech, [email protected] wrote:
any progress?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Phlya/adjustText/issues/7#issuecomment-427463168, or mute the thread https://github.com/notifications/unsubscribe-auth/ACwsumAAWjKFeadvqrRldK5yCGNQwkEcks5uh6jGgaJpZM4KcgMx .
For annotating line-line intersection, it is much clear to use annotation instead of text, meanwhile customizing the background of bbox make the label more obvious.

Another case of annotation label
before

after

Manually adjusting the annotation label make it meaningful.
For text label,
after adjustText

In spite of the location of text label is adjusted, it will mess up either. Cause there is no boarder for numbers, when the digits are too close, it is difficult to distinguish.
eg
123 45 vs 12 345
The main difference between ax.text and ax.annotation is that the text is for points only and annotation is suitable for higher dimension geometric elements.
Have you tried just changing the bbox properties of text before adjusting it? And I think arrows with an angle can be specified with arrowprops in adjust_text?
Sorry, I'm travelling without a laptop, so can't try it myself.
On Sat, 6 Oct 2018, 07:39 yech, [email protected] wrote:
The main difference between ax.text and ax.annotation is that the text is for points only and annotation is suitable for higher dimension geometric elements.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Phlya/adjustText/issues/7#issuecomment-427548264, or mute the thread https://github.com/notifications/unsubscribe-auth/ACwsugAjFxG1bUELm-Fity43oNAcjTE-ks5uiEIagaJpZM4KcgMx .
Hi, is there any workaround for this? Maybe a snippet to get the text from annotations would help. Thanks