Skip to content

plot composition: theme(figure_size) ignored in 0.16a3 #1036

@ilia-kats

Description

@ilia-kats

I'm trying to reproduce the example, but I can't get the composition to change size.

from plotnine import (
    ggplot,
    aes,
    geom_point,
    geom_boxplot,
    geom_bar,
    geom_smooth,
    facet_wrap,
    labs,
    theme,
    theme_538,
    element_rect,
    element_text,
)
from plotnine import *
from plotnine.composition import plot_spacer
from plotnine.data import mtcars
p1 = ggplot(mtcars, aes("disp", "qsec")) + geom_smooth()
p2 = ggplot(mtcars, aes("wt", "mpg")) + geom_point()
p3 = ggplot(mtcars, aes("factor(gear)", "mpg")) + geom_boxplot()
p4 = ggplot(mtcars, aes("carb")) + geom_bar()

composition = (p1 | (p2 / p3) | p4)

Running

composition + theme(figure_size=(20, 20))

with different values for figure_size always results in the same plot. It works with plotnine 0.15.3.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions