I'm excited to finally release the new version of plot_likert, 0.4.0, with a whole set of improvements that have accumulated over the last few months.
New features & APIs
- 25 - Arbitrary arguments (kwargs) passed to the `plot_likert` function will get passed through to matplotlib - thank you rnikiforova for the PR and the associated documentation improvements!
For instance, this lets you pass in an Axis object, and then the plot will be drawn on it. See 30 and the [user guide](https://github.com/nmalkin/plot-likert/blob/master/docs/guide.ipynb) for examples.
- 683f399d923feed8874ebbceb862eb3893038cdf - Allow pandas Series as inputs to `plot_likert` (previously only DataFrames could be inputs)
- 6d334d96d4686c76c7031cef004d82537f2053bf - Add option to label each segment of the plot with the number of it represents. To use it, pass `bar_labels=True` to `plot_likert`. [See the docs for full example](https://github.com/nmalkin/plot-likert/blob/master/docs/guide.ipynb#Labeling-bar-values). Note that this requires matplotlib version 3.4.0 or higher
![image](https://user-images.githubusercontent.com/903179/161411892-8f48d9dd-d12b-4e88-9eba-52e0e3056268.png)
Improvements
- 117c0ea7cef012c37a4f9ad832e5ab4ec4b522fd - Add built-in "likely" scale
- be59a472d6fa42047d1dd1fba6e9ee13bc0260a4 - Add built-in color scheme for scales with 4 items
- a836a354d068a8196aedc4d42202fdc4fd5ba78c, 7bc2cf865a14fe14aa7e27127422b3d60e324e7b - Reduce padding in plots
- e65f77f2581388ae78bd47fd6e52fcc24e1085f4 - Add built-in color scheme with a darker neutral color
API changes
24 - API change for the `plot_counts` function. (Note that this is a "secondary"/helper function. Most people probably use the `plot_likert` entry point instead and are therefore unaffected.)
1. Deprecate the `plot_percentage` parameter with a warning (but keep it around for backwards compatibility)
2. Add new parameter `compute_percentages` that converts the count to percentages
Fixes
- ae0f8d0293aa53827029a54b2d463cc8654c14cd - Change likert5 color scheme to support transparent background
- 08e19a549f219d684a6eb362220408fd5db3cf4c - Ensure at least one tick mark always appears - thanks rnikiforova!
- 055862fad50db60e54c27bbebd6aba901a2399aa - Internal imports are no longer exposed in module object
- 08e96d5a8abc989658e6322ee8c01d85761f4734 - Fix bug that sometimes produced a `TypeError` when trying to plot data that had `NA` values