Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for CDF? #119

Open
yjk21 opened this issue Nov 3, 2017 · 1 comment
Open

Support for CDF? #119

yjk21 opened this issue Nov 3, 2017 · 1 comment

Comments

@yjk21
Copy link

yjk21 commented Nov 3, 2017

Great project!
Does it support generating cumulative distribution function plots, like in pyplot (e.g. https://matplotlib.org/examples/statistics/histogram_demo_cumulative.html)?
Thanks

@mgoeminne
Copy link

Hello,

I don't reckon the lib supports cdf, per se, but you can definitely plot something that looks like your figure.

For plotting survival estimates, I use something like

Vegas.layered("Kaplan-Meier")
         .withDataFrame(cat_model)
         .withLayers(
            Layer() 
               .mark(Area)     
               .encodeX("event_at", axis=Axis(title=x_label))
               .encodeY("lower_ci", axis=Axis(title="Survival"))
               .encodeY2("upper_ci")
               .encodeColor(category_name, Nominal)
               .configMark(opacity=opacity, interpolate=StepBefore),
           Layer()
              .mark(Line)
              .encodeX("event_at", Quant)
              .encodeY("estimate", Quant)
              .encodeColor(category_name, Nominal)
              .configMark(interpolate=StepBefore)
        )

So, basically, I use interpolate=StepBefore for getting the "cdf effect".

survival per regime

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants