leeper / slopegraph

Edward Tufte-Inspired Slopegraphs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Plot.new() needed for ggslopegraph?

bshor opened this issue · comments

I'm using ggslopegraph() exclusively because of how awesome it looks and how great ggplot2 is. But when I call ggslopegraph() initially I get the following error:

Error in strwidth(sprintf(fmt, long[["value"]])) : 
  plot.new has not been called yet

While invoking plot.new() works, this should not be necessary, right? I've never needed to call it for any other ggplot2 methods.

Looks like a but. I think it's here: https://github.com/leeper/slopegraph/blob/master/R/ggslopegraph.R#L138. Probably the strwidth() function (because nothing has been plotted at that point). I'll try to fix.