Coder Social home page Coder Social logo

Comments (7)

Phlya avatar Phlya commented on July 1, 2024

Hi, can you try setting these parameters in the text objects before adjusting them? I think the reason is probably because I update properties of annotations after they are created using properties if the text object. But I'm not at a computer right now and can't check myself.

from adjusttext.

Khris777 avatar Khris777 commented on July 1, 2024

Doing

for i in range(len(fig.axes[0].texts)):
    fig.axes[0].texts[i].set_fontsize(10)

before calling adjust_text works fine. The text has the correct size and is adjusted with respect to the size.

from adjusttext.

Phlya avatar Phlya commented on July 1, 2024

OK, thanks, good! I should mention this somewhere.
Also it makes much more sense to set this to the text objects initially, because their size influences how they will be adjusted, so if you change the text size in the annotations they might start overlapping.

from adjusttext.

jolespin avatar jolespin commented on July 1, 2024

Has this been fixed?

from adjusttext.

Phlya avatar Phlya commented on July 1, 2024

What exactly? args and kwargs should be passed to ax.annotate, but only those affecting the connecting arrow will do anything. All text properties should be applied to the original text objects when creating them.

from adjusttext.

jolespin avatar jolespin commented on July 1, 2024

Oh ok so it preserves those? Nice, that makes a lot of sense.

So it would be something like this in the example above?

kwargs = {"fontsize":15}
for xt, yt, s in zip(df.B, df.A, df.A):
    texts.append(mpp.text(xt, yt, s, **kwargs))

from adjusttext.

Phlya avatar Phlya commented on July 1, 2024

Yep, everything should be preserved!

from adjusttext.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.