How to Create a Parliament Plot in R with ggparliament
top of page

How to Create a Parliament Plot in R with ggparliament

person typing on laptop

Overview

A parliament plot is a type of data visualization used to represent the composition of a legislative body, such as a parliament or congress. This plot visually illustrates how many seats each political party or group holds within the assembly, providing a clear and immediate understanding of the political landscape. The design of a parliament plot often mimics the semi-circular or circular seating arrangement found in many parliamentary chambers, with each segment representing seats occupied by different parties. This allows for an intuitive and aesthetically pleasing way to comprehend the distribution of power and the balance between various political factions.

Example of a parliament plot.

example of a parliament plot

Step-by-step guide in R with ggparliament

To create a parliament plot in R using the ggparliament package, first load the necessary libraries.

loading the necessary libraries

Next, set your working directory and load the required datasets.

setting working directory and loading data

View the sample datasets.

Uganda Parliament Data

sample data

Tanzania National Assembly Data

sample data

Create a parliament plot based on Uganda dataset using the code below. (note, plot type = circle).

r code on how to create a parliament plot with ggparliament

Note: Using paletteer package you can easily choose and apply the right colors to your visualization.

Executing the above code results in.

circular parliament plot

With a few changes on the code, you can plot Tanzania data as a semi-circle using the code below.

r code on how to create a parliament plot with ggparliament

Executing the above code plots the view below.

semi-circular parliament plot

Note, you can change the plot type to “classroom” using the code below.

r code on how to create a parliament plot with ggparliament

Executing the above code plots the view below.

classroom parliament plot

Conclusion

Creating a parliament plot in R using the ggparliament package is a powerful way to visualize the composition of legislative bodies. By following the step-by-step guide, you have learned how to harness the capabilities of ggparliament to produce a clear, visually appealing representation of political data. This method not only aids in the analysis of the distribution of power among various political groups but also enhances the communication of complex political structures to a broader audience. With these tools, you can effectively convey the nuances of parliamentary compositions and support informed decision-making and discussions surrounding legislative demographics.

If you like the work we do and would like to work with us, drop us an email on our contacts page and we’ll reach out!

Thank you for reading!

Original.png

We Support You Deliver Business-Focused Solutions That Enable Data-Driven Decision Making.

  • Tableau profile
  • YouTube
  • White LinkedIn Icon
  • Facebook
  • X

QUICK LINKS

CONTACT US

+254 738 307 495

East Gate Mall, Donholm

3rd Floor Suite No. 3i

Nairobi, Kenya

Join our mailing list

bottom of page