has2k1 / plotnine

A Grammar of Graphics for Python

Home Page:https://plotnine.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`ggtitle` should accept keyword arguments

krassowski opened this issue · comments

Calling:

ggtitle(title='something')

Raises:

TypeError: ggtitle.__init__() got some positional-only arguments passed as keyword arguments: 'title'

This was introduced recently by 0b147f0

plotnine/plotnine/labels.py

Lines 139 to 150 in a3d893f

class ggtitle(labs):
"""
Create plot title
Parameters
----------
title :
Plot title
"""
def __init__(self, title: str, /):
self.title = title

ylab/xlab also have a similar issue but it is more notable for ggtitle because coming from ggplot I am used to calling ggtitle(title='something', subtitle='something else')