Skip to content

[Question] Is it possible to use the library to plot timeseries (non-KDE) data? #214

Answered by tpvasconcelos
guidocioni asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @guidocioni ! Nice example! 👍

And yes, you can currently do this with the library!

You need to use the (perhaps not very intuitively named) densities parameter. For your use case, you should pass it in a shallow format.

Here's a very basic example:

from ridgeplot import ridgeplot

fig = ridgeplot(
    densities=[
        [(0, 0), (1, 1), (2, 0)], # 2021-2022
        [(1, 0), (2, 1), (3, 0)], # 2022-2023
        [(2, 0), (3, 1), (4, 0)], # 2023-2024
    ],
    labels=["2021-2022", "2022-2023", "2023-2024"],
)
fig.show()

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by tpvasconcelos
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
2 participants
Converted from issue

This discussion was converted from issue #170 on October 08, 2024 14:28.