Skip to content

How to plot ccdf? #234

Closed
Closed

Description

@guilhermeleobas

Hi,

I am having some problems trying to plot the ccdf with plotnine. In R, I can do the following:

p <- ggplot(df, aes(x=Z))
p + geom_line(aes(y = 1 - ..y..), stat='ecdf')

But I can't replicate this same functionality on plotnine.

Activity

  1. has2k1 commented on Nov 27, 2018

    @has2k1
    Owner

    Please post at minimal reproducible example in python.

  2. guilhermeleobas commented on Nov 27, 2018

    @guilhermeleobas
    Author
    df = pd.DataFrame({'x' : [1, 2, 2.5, 4], 'y' : [2, 10, 40, 52]})
    
    (ggplot(df, aes(x='x'))
     + geom_line(aes(y='1-..y..'), stat='ecdf')
    )

    edit: From what I could investigate, the problem is on scales.py:252. For this particular case, data[col] returns a dataframe instead of a series because there are two columns with the same name (y).

  3. guilhermeleobas commented on Dec 2, 2018

    @guilhermeleobas
    Author

    Btw, I can work on a PR to fix this if you want. Just guide me a bit on what should be the expected result for this specific case I will work on a fix.

  4. has2k1 commented on Dec 3, 2018

    @has2k1
    Owner

    No worries I fixed it and stashed it. I just need to commit and push.

  5. added 2 commits that reference this issue on Dec 28, 2018
    4256074
    9373e5f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions