Skip to content
This repository has been archived by the owner on Nov 2, 2023. It is now read-only.

Issue with x_range (and y_range) breaking ly_abline #222

Open
joj3810 opened this issue Nov 24, 2017 · 0 comments
Open

Issue with x_range (and y_range) breaking ly_abline #222

joj3810 opened this issue Nov 24, 2017 · 0 comments

Comments

@joj3810
Copy link

joj3810 commented Nov 24, 2017

(Using 0.5.1)
I've just come across an issue using ly_abline together with x_range when plotting a discrete axis.

Plotting an abline (using h or v) works fine when x_range is not called, but when I add in x_range in order to set the order, only a small section of the horizontal abline gets plotted (i.e. it no longer traverses the entire width of the plot). I've seen the issue with ly_bar and ly_points plots and it affects both x_range and y_range.

capture
Reproducible example:

#Set up data frame
set.seed(2)
test_frame <- data.frame("factor_x"=sample(letters,10),"data_x"=sample(10:30,10))

#This works fine..
figure(test_frame) %>% ly_bar(x=factor_x,y=data_x) %>% ly_abline(h=15) 

#..but when x_range is added, the issue appears
figure(test_frame) %>% ly_bar(x=factor_x,y=data_x) %>% ly_abline(h=15) %>% x_range(test_frame$factor_x)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant