Coder Social home page Coder Social logo

Comments (7)

Phlya avatar Phlya commented on September 28, 2024

from adjusttext.

hennumea avatar hennumea commented on September 28, 2024

I have tried switching 'on_basemap' argument, but no difference. An alternative for me is to use pyplot.pcolormesh, where adjust_text seems to work fine, but that means that I have to rewrite a good chunk of code.

pyplot.imshow places the origin of the image at the top by default, because most images (as with the ultrasound images I'm trying to annotate) are scanned from top to bottom (same with image sensors, I guess). I assume that it have something to do with how the axes are handled which confuses adjust_text.

from adjusttext.

Phlya avatar Phlya commented on September 28, 2024

from adjusttext.

hennumea avatar hennumea commented on September 28, 2024

When i set the origin to the bottom left corner, everything works fine. So it seems that the inverted axes are the problem, indeed.

I found a relatively quick workaround which is acceptable for me:

  1. Invert the image using numpy.flip when calling imshow, and set the origin to 'lower' to avoid a reversed axis. The extent of the image alos needs to be changed (yex, 0) -> (0, yex) .
  2. Invert the y-coordinate of the points to be annotated
  3. Set the y-axis tick mark labels manually to display an inverted axis

More neat solutions will be appreciated!

from adjusttext.

Phlya avatar Phlya commented on September 28, 2024

from adjusttext.

Phlya avatar Phlya commented on September 28, 2024

I'll close this since it has already been reported to multiple times - but really need to get this working!

from adjusttext.

Phlya avatar Phlya commented on September 28, 2024

FYI the fix was even simpler than I thought, and this should now work as expected in the latest version in the repo.

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.