sirrice / pygg

ggplot2 syntax in python. Actually wrapper around Wickham's ggplot2 in R
MIT License
73 stars 9 forks source link

Remove special code for facet_* #11

Closed depristo closed 9 years ago

depristo commented 9 years ago

facet_grid and facet_wrap have a special API right now to handle the formulas in R. Update the code so that the interface isn't specialized and you use the functions directly with escaped strings:

Today:

p = p + facet_grid('x', 'y')

Proposed API:

p = p + facet_grid(esc("x ~ y"))
sirrice commented 9 years ago

What do you think of escaping in the background?

p = p + facet_grid("x ~ y")
depristo commented 9 years ago

It'd be fine but those two functions will have slightly different apis than all other functions that have to pass in strings. I'd recommend against it, but it's up to you

sirrice commented 9 years ago

We goofed -- escaping not needed.