Search code examples
pythonmatplotlibridgeline-plot

Demo of Joypy (joyplots in python) not working?


I'm working off the NBA example in: http://sbebo.github.io/blog/blog/2017/08/01/joypy/

I follow the instructions, but my plot does not have the proper colormap. Every one of my histograms is the lowest value on the colormap (yellow in this case). Any suggestions?

Example from joypy that should have range of colors, but is just all yellow.


Solution

  • If the only problem is that the colors in the joyplot are not shown correctly, this is due to the normalization performed, where the levels are divided by the number of curves. Since the number of curves is an integer number, a division like curve_number/ncurves will result in 0 in python 2. In python 3 this is a float.

    Hence it will probably be sufficient to make the division work in the code.

    Locate joyplot.py in your sitepackages folder and add

    from __future__ import division
    

    as very first line in that file.