Code Monkey home page Code Monkey logo

Comments (4)

TyberiusPrime avatar TyberiusPrime commented on June 11, 2024

I presume you do not want to read va from a column 'top' of your dataframe.
If so, you need to pass it outside of the aes.

from plotnine.

CopyOfA avatar CopyOfA commented on June 11, 2024

The docs on geom_text specify to put it in the aes field: https://plotnine.readthedocs.io/en/v0.12.4/generated/plotnine.geoms.geom_text.html#plotnine.geoms.geom_text

If I put the va="top" in the geom_text call, then all the text is place at the default location: "center".

from plotnine.

TyberiusPrime avatar TyberiusPrime commented on June 11, 2024

Each mapping can be either sourced from the underlying dataframe (with an 'aesthetic' = aes() call), or set to a constant value by being passed 'on the outside'.

See for example the label being set to the constant 'name' (below).

At least in my version (0.12.2), the text does shift:

image

from plotnine.

CopyOfA avatar CopyOfA commented on June 11, 2024

I see, I was confused about the meaning of the positions (i.e., "top" puts the label below the point). Thanks for helping out!

from plotnine.

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.