Skip to content

The position of the title cannot be set in plotnine. #36

@CaoTianze

Description

@CaoTianze

Hi ponnhide. I want to set the title to the left. This is used to tag the image.

from plotnine import ggplot, geom_point, aes, ggtitle, theme, element_text
from plotnine.data import mtcars
import patchworklib as pw
ggplot(mtcars, aes('wt', 'mpg', color='factor(gear)'))+ geom_point()+ggtitle('A')+theme(plot_title=element_text(size=30,ha='left'))
ggplot(mtcars, aes('wt', 'mpg', color='factor(gear)'))+ geom_point()+ggtitle('B')+theme(plot_title=element_text(size=30,ha='left'))
A=ggplot(mtcars, aes('wt', 'mpg', color='factor(gear)'))+ geom_point()+ggtitle('A')+theme(plot_title=element_text(size=30,ha='left'))
B=ggplot(mtcars, aes('wt', 'mpg', color='factor(gear)'))+ geom_point()+ggtitle('B')+theme(plot_title=element_text(size=30,ha='left'))
section1=pw.load_ggplot(A)|pw.load_ggplot(B)
section1.savefig()

However, the title can be left in plotnine. but it is still in the center in patchworklib.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions