plot¶
The plot module provides users with Python only implementations of common electoral plots.
A novel addition to social science analysis is the disproportionality bar plot, which graphically depicts the disproportionality between expected and realized results. Bar widths are the proportion of shares (ex: votes received), and heights are the difference or relative difference between shares and allocations (ex: parliament seats received).
Functions
poli_sci_kit.plot.disproportionality_bar_plot()poli_sci_kit.plot.parliament_plot()poli_sci_kit.utils.gen_parliament_plot_points()poli_sci_kit.utils.swap_parliament_allocations()
poli_sci_kit also provides Python only implementations of both rectangular and semicircle parliament plots:
The parliament plot function is built on top of scatter plots that are derived in the package’s utils module:
A final function to swap poorly allocated seats is also provided in utils: