question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when setting labels=False in plotting.add_at_risk_counts().

See original GitHub issue

For lifelines 0.25.0. Getting an AttributeError: 'NoneType' object has no attribute 'replace' because all labels are set to None if labels is False:

    if labels is None:
        labels = [f._label for f in fitters]
    elif labels is False:
        labels = [None] * len(fitters)

    labels = [l.replace("_", r"\_") for l in labels]

And is it possible to disable the rows ‘Censored’ and/or ‘Events’ in the ‘At risk’ counts? To have that configurable, or is it already configurable?!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
CamDavidsonPiloncommented, Aug 1, 2020
  1. I’ve add a rows_to_show kwarg in add_at_risk_counts that can configure what is shown.
  2. I think I’ve fixed the alignment problem (by remove the italics…)
  3. the original labels=False problem should be fixed.

All in the latest v0.25.1

1reaction
agnesbaocommented, Aug 1, 2020

I think it’s the italic font somehow creates extra space on the first column. If i take out the italic font setting, or add it to the rest of ticks by changing this line: https://github.com/CamDavidsonPilon/lifelines/blob/cae49555be8c66a09c95ba28f52189941aa89821/lifelines/plotting.py#L491 into lbl += "$\\mathit{}$" + s.format(c) then it look aligned. (Haven’t tried the is_latex_enabled() yet)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error plotting labels gnuplot - Stack Overflow
I would like to add the label (column 3). If i try plot '/root/temp.txt' using 2:xtic(1):3 with labels notitle it makes error...!
Read more >
Visualizing Error — ggerrorplot • ggpubr - R Packages
logical value. Default is FALSE. Used only when y is a vector containing multiple variables to plot. If TRUE, create a multi-panel plot...
Read more >
[ncl-talk] How to have a plot with different panel label bar
Looking at those error messages more closely: are you setting the gsnSpreadColors in your res2 resource list for your xy plot?
Read more >
getdist.plots — GetDist 1.4 documentation
An exception that is raised when there is an error plotting. class getdist.plots. ... False: colored lines/boxes are drawn before black labels.
Read more >
Manually create legend in Plots.jl - Julia Discourse
The legend might show a colored line paired with a label: (b… ... Try setting label=false in the previous plots. 1 Like. Christopher_Fisher...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found