0

I am trying to plot a .csv-file into a joy diagram in python, using the package 'joypy'. (in my code that's 'data').

For aesthetics I want the diagram to only show every tenth year on the label (that's age). Examples here:

However, if I try to reproduce this with:

labels = [y if y%5==0 or y==64 else None for y in list(data.age.unique())]  
fig, axes = joypy.joyplot(data, column=['testresults'], by='age', overlap=3, labels=labels, linewidth=0.5, grid='both', range_style='own', figsize=(6,5))

All I get are these warnings:

RuntimeWarning: invalid value encountered in double_scalars

in joyplot return _joyplot(converted, labels=labels, sublabels=sublabels,

in _joyplot
assert len(labels) == num_axes
AssertionError

Does anyone know a way to only depict every tenth year in a joyplot ?

smile
  • 574
  • 5
  • 11
  • 1
    Some hints to obtain useful answers: write a minimal executtable example (don't forget toy data and including all libraries); when showing the error trace, just copy-paste the full thing in a code section (between triple backquotes ```) without adding gibberish comments in-between. You might want to read [How to ask](https://stackoverflow.com/help/how-to-ask) – JohanC Jun 13 '20 at 16:06
  • @eli saas Hi, could you provide sample of y and data? And is there need to add None to the y labels as written in the else statement? Thanks – smile Jul 25 '20 at 07:56

0 Answers0