Closed spacecowboy closed 10 years ago
Hm, is this also a Pandas problem? That is, if I have Latex enabled, and underscores in a dataframe's column name, does that break Pandas .plot
too?
Yes it would seem that it is. Loading a csv-file with pandas, and calling plot on the dataframe results in:
/usr/local/lib/python3.4/site-packages/IPython/core/formatters.py:239: FormatterWarning: Exception in image/png formatter: LaTeX was not able to process the following string: 'study_id,id'
But the difference is that I can change the column names in the dataframe. The "_upper_0.95" is not as easily changed.
True, that's a change I can (and will) make. Thanks!
Great!
@spacecowboy, I added an API to change the labels:
kmf = KaplanMeierFitter()
ci_labels = ['upper', 'lower']
kmf.fit(T, ci_labels=ci_labels)
print kmf.confidence_interval_.columns
#['upper', 'lower']
Run a
pip install --upgrade --no-deps git+https://github.com/CamDavidsonPilon/lifelines.git
to pull master.
The labels "_upper_0.95" and "_lower_0.95" break plotting if LaTeX is enabled:
The problem is that LaTeX hates underscores... The text might also look bad if matplotlib interprets the legend as mathmode (not sure if it does). One could imagine something like this: