1

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.

Marcus Campbell
  • 2,746
  • 4
  • 22
  • 36
Dan Fiorino
  • 388
  • 1
  • 3
  • 17
  • It looks like my python version is actually **2.7.13** instead of **3.5** as stated by my Jupyter Notebook! (Python 3.5+ is a requirement by the package) – Dan Fiorino Oct 13 '17 at 00:17
  • 1
    Try the following: Locate `joyplot.py` in your sitepackages folder and add `from __future__ import division` as very first line in that file. I would guess that this would be enough to make it compatible with python 2, although I haven't tested. – ImportanceOfBeingErnest Oct 13 '17 at 00:34
  • Write that up as the answer! Because it worked! – Dan Fiorino Oct 13 '17 at 15:29

1 Answers1

1

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.

ImportanceOfBeingErnest
  • 321,279
  • 53
  • 665
  • 712
  • I'm getting a similar issue: my time series has 2 gaps, one in 1954 and the another in 1977. My message error is: ValueError: `dataset` input should have multiple elements. Even including 0 in those dates, this message continues appearing. On the other hand, doing KDE by Seaborn, it works. Do you have any idea? – vicemagui Aug 05 '18 at 18:40