https://github.com/nmalkin/plot-likert
Python library to visualize results from Likert scale survey questions
https://github.com/nmalkin/plot-likert
likert likert-scale-survey matplotlib plot-likert python survey-questions visualization
Last synced: 3 months ago
JSON representation
Python library to visualize results from Likert scale survey questions
- Host: GitHub
- URL: https://github.com/nmalkin/plot-likert
- Owner: nmalkin
- License: bsd-3-clause
- Created: 2019-01-01T07:36:17.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-06-07T20:45:21.000Z (about 2 years ago)
- Last Synced: 2025-11-27T18:53:56.376Z (7 months ago)
- Topics: likert, likert-scale-survey, matplotlib, plot-likert, python, survey-questions, visualization
- Language: Python
- Homepage:
- Size: 5.87 MB
- Stars: 111
- Watchers: 3
- Forks: 30
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Plot Likert
===========
This is a library to visualize results from [Likert-type](https://en.wikipedia.org/wiki/Likert_scale) survey questions in Python, using [matplotlib](https://matplotlib.org/).

Installation
------------
Install the latest stable version from PyPI:
```shell
pip install plot-likert
```
To get the latest development version:
```shell
pip install --pre plot-likert
# OR
pip install git+https://github.com/nmalkin/plot-likert.git
```
Quick start
-----------
```python
# Make sure you have some data
import pandas as pd
data = pd.DataFrame({'Q1': {0: 'Strongly disagree', 1: 'Agree', ...},
'Q2': {0: 'Disagree', 1: 'Strongly agree', ...}})
# Now plot it!
import plot_likert
plot_likert.plot_likert(data, plot_likert.scales.agree, plot_percentage=True);
```
Usage and sample figures
------------------------
To learn about how to use this library and see more example figures,
[visit the User Guide, which is a Jupyter notebook](https://github.com/nmalkin/plot-likert/blob/release/docs/guide.ipynb).
Want to see even more examples? [Look here](docs/lots_of_random_figures.ipynb)!
Background
----------
This library was inspired by Jason Bryer's great [`likert` package for R](https://cran.r-project.org/web/packages/likert/) (but it's nowhere near as good).
I needed to visualize the results of some Likert-style questions and knew about the `likert` R package but was surprised to find nothing like that existed in Python, except for a [Stackoverflow answer by Austin Cory Bart](https://stackoverflow.com/a/41384812). This package builds on that solution and packages it as a library.
I've since discovered that there may be other solutions out there.
Here are a few to consider:
- https://github.com/dmardanbeigi/Likert_Scale_Plot_in_Python
- https://github.com/Oliph/likertScalePlot
- https://blog.orikami.nl/behind-the-screens-likert-scale-visualization-368557ad72d1
While this library started as a quick-and-dirty hack,
it has been steadily improving thanks to the contributions of a number of community members and [Fjohürs Lykkewe](https://www.youtube.com/watch?v=ef7cTuVUiWs).
Thank you to everyone who has contributed!