nmalkin / plot-likert

Python library to visualize results from Likert scale survey questions
BSD 3-Clause "New" or "Revised" License
102 stars 25 forks source link

Legend in x axis #3

Closed antonioalmeida closed 4 years ago

antonioalmeida commented 4 years ago

Hey, great package you've got here.

However, I can't get likert_counts to show the number of responses in the x axis.

Following the example notebook I can get both counts and percentages, but only the percentages plot version shows the x axis legend.

import plot_likert as pl

# (...) prepare data 

counts = pl.likert_counts(df, pl.scales.scores6) # this works
percentages = pl.likert_percentages(df, pl.scales.scores6) # this also works

# output 1
pl.plot_counts(counts, pl.scales.scores6, colors=pl.colors.likert6) # doesn't show the axis

#output 2
pl.plot_counts(percentages, pl.scales.scores6, colors=pl.colors.likert6) # works (not really showing counts, rather percentages)

Output 1

image

Output 2

image

Any tips?

nmalkin commented 4 years ago

Hi, I'm glad you're finding this package useful!

The issue you experienced was a bug with how the x-axis tick marks were generated. I've pushed a fix that should hopefully make them work as expected. (There are more details in the commit message.) Let me know!

antonioalmeida commented 4 years ago

Perfect. You even fixed the left-pad thingy. Kudos for the timely response

image

nmalkin commented 4 years ago

Great! Thanks for reporting the issue.