USGS-R / gsplot

plotting foundation for timeseries reporting
Other
6 stars 14 forks source link

reset logs before adding default_view #472

Closed lindsayplatt closed 7 years ago

lindsayplatt commented 7 years ago

Addressing error found by @zmoore-usgs when side 2 had negatives, but you were logging side 4. Side 4 was last to be added, so par('ylog') was TRUE when print got to set_frame for the default view and failed because of the negative values on side 2. Fix was to reset pars before adding default_view.

plot2 <- gsplot() %>% 
  points(side=2, 1,-1) %>% 
  points(side=4, 100, 102) %>%
  view(side=4, log='y')
plot2

# this was the error that popped up, but doesn't now
Error in plot.window(xlim = xlim(object, as.x_side(view.name)), ylim = ylim(object,  : 
  Logarithmic axis must have positive limits
coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.09%) to 80.612% when pulling bc686a5411a3e10a72e64f572ded32d8d225db07 on lindsaycarr:master into f9cc1bfee8f7c9b478206cea63b1047a2cc482ae on USGS-R:master.

zmoore-usgs commented 7 years ago

Tested the fix in Repgen and it seems to work properly now!