leotac / joypy

Joyplots in Python with matplotlib & pandas :chart_with_upwards_trend:
MIT License
559 stars 59 forks source link

Color gradient along horizontal axis rather than the vertical axis #70

Open flehner opened 9 months ago

flehner commented 9 months ago

It seems joypy was used to create this prominent figure copied below: https://ichef.bbci.co.uk/news/1536/cpsprodpb/1216F/production/_132259047_global_temp_delta_1991_2020avg_multiple_ridges_v2-2x-nc.png.webp

In it, the colormap gradient runs along the horizontal axis of each individual filled KDE plot, rather than along the vertical axis which is what happens by default when you pass a colormap into joyplot. How can you achieve this with joypy.joyplot?

image

officialankan commented 9 months ago

this library uses matplotlib's fill_between, I guess we would have to switch to imshow, or draw an unreasonable amount of fill_between and cycle through a colormap

wonder route BBC took? :)

flehner commented 9 months ago

I realized since that it's also possible that they used R's ggridges, in which it's easy to implement such horizontal color gradients.

leotac commented 9 months ago

In all honesty I don't think they used joypy :-)

Il gio 11 gen 2024, 21:11 Flavio Lehner @.***> ha scritto:

I realized since that it's also possible that they used R's ggridges, in which it's easy to implement such horizontal color gradients.

— Reply to this email directly, view it on GitHub https://github.com/leotac/joypy/issues/70#issuecomment-1887889870, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKAEOUUV6S7C4ZE6R3HLTLYOBBP7AVCNFSM6AAAAABBUZOYISVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBXHA4DSOBXGA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

yangyxt commented 8 months ago

Is there any updates ? Can we achieve horizontal gradient colors ? Its super important. Thanks!

flehner commented 8 months ago

I admit I did not pursue this further since I found the R solution mentioned above. image