Iām wondering if thereās any way to set a specific order in treemap px. The path function works, but I wanna set an order inside of one category, and category_orders doesnāt exist as an input for treemap.
To be more precise: My path includes āTimepointā and I have three timepoints (1,2,3) that I wanna show in ascending order. However I have more data in timepoint 3 than 2 (as you can thereās 2 additionnal rectangles inside Time 3 relatively to Time 2), causing it to show before timepoint 2.
Hi @jayjay
I donāt think treemap has category_orders, so one way to get around this might be to pre-sort your dataframe: df_sorted = df.sort_values(['Timepoint']).
Here looking for the same answer, having already tried sorting the df by day. I am using it to see water consumption by day and its starting with Thursday - the day with the highest consumption/sum of values. Such behavior is limiting the plot for use of things such as datetime - @adamschroeder any chance of raising it as a request to make this possible.
Thanks for the reproducible example! You can use the treemapās sort attribute to do this. By default itās set to true so that the sectors are ordered from largest to smallest but you can disable it by setting sort=False. E.g I think this code does what youāre looking to do: