Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
CaoTianze opened this issue Mar 14, 2023 · 1 comment
Closed

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

CaoTianze opened this issue Mar 14, 2023 · 1 comment

Comments

@CaoTianze
Copy link

CaoTianze commented Mar 14, 2023

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.

@jeremywzh
Copy link

I experienced the same problem. After calling pw.load_ggplot, all titles are in the center.
patchworklib 0.5.2
plotnine 0.10.1
matplotlib 3.6.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants