Open gabrielleny opened 8 years ago
When tried to add a legend in ggvis, it threw an error as titled.
the data is like this:
combine Source: local data frame [25 x 5]
year month hh sr date
(dbl) (dbl) (dbl) (dbl) (yrmn) 1 2014 10 -5915852 -0.02335266 Oct 2014 2 2014 9 -5661353 -0.01702594 Sep 2014 3 2014 8 -6755627 -0.02706916 Aug 2014 4 2014 7 -7140854 -0.02745636 Jul 2014 5 2014 6 -7310980 -0.02843833 Jun 2014 6 2014 5 -7573923 -0.02811327 May 2014 7 2014 4 -8295373 -0.02896235 Apr 2014 8 2014 3 -9158207 -0.02923535 Mar 2014 9 2014 2 -9847585 -0.03114963 Feb 2014 10 2014 1 -9774175 -0.03078533 Jan 2014 .. ... ... ... ... ...
The code is like: combine %>% ggvis(~date,~hh/100000000) %>% layer_paths(stroke:='green') %>% layer_paths(y=~sr, stroke:='orange') %>% add_legend("stroke")
Error is like: Error in present_scales[[1]] : subscript out of bounds
Could someone help please?
Thanks in advance!
Same thing happened to me too. Only change I could "effect": adding a "title" makes the error go away but a blank plot appears.
When tried to add a legend in ggvis, it threw an error as titled.
the data is like this:
(dbl) (dbl) (dbl) (dbl) (yrmn) 1 2014 10 -5915852 -0.02335266 Oct 2014 2 2014 9 -5661353 -0.01702594 Sep 2014 3 2014 8 -6755627 -0.02706916 Aug 2014 4 2014 7 -7140854 -0.02745636 Jul 2014 5 2014 6 -7310980 -0.02843833 Jun 2014 6 2014 5 -7573923 -0.02811327 May 2014 7 2014 4 -8295373 -0.02896235 Apr 2014 8 2014 3 -9158207 -0.02923535 Mar 2014 9 2014 2 -9847585 -0.03114963 Feb 2014 10 2014 1 -9774175 -0.03078533 Jan 2014 .. ... ... ... ... ...
The code is like: combine %>% ggvis(~date,~hh/100000000) %>% layer_paths(stroke:='green') %>% layer_paths(y=~sr, stroke:='orange') %>% add_legend("stroke")
Error is like: Error in present_scales[[1]] : subscript out of bounds
Could someone help please?
Thanks in advance!