adjustText icon indicating copy to clipboard operation
adjustText copied to clipboard

Tries to make enormous image when passed annotations instead of texts

Open alphapapa opened this issue 9 years ago • 12 comments

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.

alphapapa avatar Oct 20 '16 19:10 alphapapa

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.

Phlya avatar Oct 21 '16 09:10 Phlya

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?

alphapapa avatar Oct 22 '16 04:10 alphapapa

Should be quite similar, you just need to figure out how to get bbox of the text part of the annotation...

Phlya avatar Oct 22 '16 22:10 Phlya

Ok, thanks. I might take a look at this again in a few weeks. :)

alphapapa avatar Oct 23 '16 00:10 alphapapa

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 .

Phlya avatar Oct 25 '16 18:10 Phlya

Is there already any RP for this feature request?

y9c avatar Oct 05 '18 18:10 y9c

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 .

Phlya avatar Oct 05 '18 19:10 Phlya

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.

image

y9c avatar Oct 06 '18 03:10 y9c

Another case of annotation label

before image

after image

Manually adjusting the annotation label make it meaningful.


For text label,

after adjustText image

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

y9c avatar Oct 06 '18 03:10 y9c

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.

y9c avatar Oct 06 '18 05:10 y9c

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 .

Phlya avatar Oct 06 '18 08:10 Phlya

Hi, is there any workaround for this? Maybe a snippet to get the text from annotations would help. Thanks

Conceptron avatar Dec 11 '23 05:12 Conceptron