Skip to content

angle argument to strip_text_x() and strip_text_y() does not seem to work #1383

@tentrillion

Description

@tentrillion

I use lets-plot in python (version 4.7.1), via a marimo interface.

Example graph, works fine

mtcars = pl.read_csv("https://raw.githubusercontent.com/selva86/datasets/master/mtcars.csv")

ggplot(mtcars, aes(x='mpg', y='wt')) +\
    geom_point() +\
    facet_grid(y='cyl') +\
    theme(panel_border = element_rect(color='black')) +\
    ggsize(height=300, width=500)
Image

Changing the angle parameter in strip_text_y() doesn't do anything

Adding strip_text_y = element_text(angle=90) to the theme() call above, and also adding strip_text_y = element_text(angle=0) give rise to the same graph as above. But at least one of those two alterations should change the rotation of the text, at least I think.

ggplot(mtcars, aes(x='mpg', y='wt')) +\
    geom_point() +\
    facet_grid(y='cyl') +\
    theme(panel_border = element_rect(color='black'), strip_text_y = element_text(angle=90)) +\
    ggsize(height=300, width=500)

gives the same graph as

ggplot(mtcars, aes(x='mpg', y='wt')) +\
    geom_point() +\
    facet_grid(y='cyl') +\
    theme(panel_border = element_rect(color='black'), strip_text_y = element_text(angle=0)) +\
    ggsize(height=300, width=500)

In contrast, changing the size parameter in strip_text_y() works fine.

(Just showing this example to suggest the problem is with the angle argument specifically.)

ggplot(mtcars, aes(x='mpg', y='wt')) +\
    geom_point() +\
    facet_grid(y='cyl') +\
    theme(panel_border = element_rect(color='black'), strip_text_y = element_text(size=20)) +\
    ggsize(height=300, width=500)
Image

I often want to change this angle when my facet labels are very long strings, so I think it would be a nice feature to have.

Thank you as always!

Metadata

Metadata

Labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions