Plotly Express author Nicolas Kruchten here… Great writeup! A few comments:
- You can set the default color scheme with
px.defaults.color_*
or the default template withpx.defaults.template
- The line graph is messy because it doesn’t sort your data for you… tack on something like
.sort_values(by='ShareWomen')
todf
and the output should look as you expect - Setting the colors explicitly is by design so you can independently control positioning and color of box/violin plots, bars etc…
- …but there is an awkward issue wherein if you set just a color and x to the same variable for box or violin plots, then it “leaves room” for cases that don’t occur, but you can grow the boxes back to full width with
boxmode='overlay'
- You can put your visualization into a presentation fairly easily by exporting it to a static format like SVG, PNG or PDF using
plotly.io
as documented here https://plot.ly/python/static-image-export/ - The lack of documentation is definitely something we’re working on! We’re hard at work on version 4 of
plotly
which will include Plotly Express asplotly.express
and a revamped documentation site that putspx
front and center with tons more examples, including all the points above. Should be done in 4–6 weeks… stay tuned :)