How to customize legends order of appearance for plotly iplot?

I have a couple of dozen traces in a butterfly plot with iplot, would like to group the legends in a customized order, wonder how to do that. I searched and found a way to do it with plotly express, but I hope to do it with iplot. Thanks in advance!

Hey @socnis, welcome to the forums. Enlighten me, what is iplot?