Skip to content

Bar labels font size #31

Answered by nmalkin
Thommenek asked this question in Q&A
Jun 1, 2022 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

Here's a solution that's a bit hacky, but it should work:

axes = plot_likert.plot_likert(data, plot_likert.scales.agree, plot_percentage=True,
                               bar_labels=True, bar_labels_color="snow", colors=plot_likert.colors.default_with_darker_neutral);

from matplotlib.text import Annotation

for child in axes.get_children():
    if type(child) == Annotation:
        child.set_fontsize('xx-large')

The font size can be a number or any of the following values: 'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'

The result looks like this:

(You can then adjust or remove the individual Annotations if they don't fit, etc.)

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Thommenek
Comment options

@Thommenek
Comment options

Answer selected by Thommenek
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants