How to sort in reverse order by preserving the order?

I also don’t understand your answer. Screenshots are not enough and the quoted code is not clear about what you are doing since it shows a call to the partial figure.html.

You need to share the project and be descriptive as mentioned in the Requesting Help guidelines.