has2k1 / plotnine

A Grammar of Graphics for Python
https://plotnine.org
MIT License
3.89k stars 209 forks source link

Strange behavior with geom_label() using boxstyle other than default (round) exept for round4 #779

Closed TerryGamon closed 2 months ago

TerryGamon commented 2 months ago

Maybe I am missing something here (setting some parameters?) but at least 'square' should be straight forward.

import plotnine as p9
from plotnine.data import mtcars

(p9.ggplot(mtcars, p9.aes('wt', 'mpg', label='name'))
 + p9.geom_point()
 + p9.geom_label(boxstyle='round')
)

so far so good:

image


import plotnine as p9
from plotnine.data import mtcars
(p9.ggplot(mtcars, p9.aes('wt', 'mpg', label='name'))
 + p9.geom_point()
 + p9.geom_label(boxstyle='square')
)

ValueError: Incorrect style argument: 'square,pad=0.25,'

same issue with:

Thanks for your hard work! Wouldn't know what to do without plotnine!