plotnine icon indicating copy to clipboard operation
plotnine copied to clipboard

Add documentation on creating custom geoms, themes, etc.

Open janfreyberg opened this issue 7 years ago • 3 comments

For ggplot2, there are many R packages that define new geom_* functions or new theme_* functions. I'd love to be able to define a new geom for plotnine (I'm particularly thinking of something similar to ggridges), but it's not clear to me how I would do that.

Maybe it'd be possible to add some developer instructions that tell you which functions to look at / which classes to inherit from when defining custom geoms.

thanks!

janfreyberg avatar Dec 20 '17 16:12 janfreyberg

Checkout the documentation for the base geom and stat classes and also look at how some geoms are implemented.

If figuring out how to "extend" in such basic ways is not obvious given the API documentation and current source code, then I think that is where the focus should be first, i.e make monkey see, monkey do easier.

has2k1 avatar Dec 21 '17 05:12 has2k1

Thanks. I started by checking other geoms (eg. geom_point) but just saw a bunch of variables defined, so it was a bit confusing.

I'll take a look at the base classes and take it from there.

janfreyberg avatar Dec 21 '17 09:12 janfreyberg

As you go through the process, can you note down "why" questions that come to you but take long to figure out. Thanks.

has2k1 avatar Dec 21 '17 17:12 has2k1