Skip to content

theme_minimal crops out facet labels (not happening with other themes) #760

@jwhendy

Description

@jwhendy

Hello, I've never run into this before so I'm suspecting it's some kind of regression. Here's a repro:

import pandas as pd
from plotnine import * 

foo = pd.DataFrame({'label': ['a', 'a', 'b', 'b'],
                    'x': [0, 1, 2, 3],
                    'y': [4, 5, 6, 7]})

By default we get:

p = ggplot(foo, aes(x='x', y='y', group=1)) + geom_line()
p = p + facet_wrap('~label')
p
image

And trying a few others:

p + theme_bw()
image
p + theme_dark()
image

However with theme_minimal() the facet labels are removed. You can try this without the additional plot background arguments to theme(), but the result is the same. I'm including it so it's white and easily seen vs. the default transparent bg:

p + theme_minimal() + theme(plot_background=element_rect(fill='white'))
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions