Skip to content

Commit

Permalink
Handle case when ylim is constant and negative
Browse files Browse the repository at this point in the history
'lim' was in reverse order when the ylim max/min were the same and
negative. This change makes sure they are in the correct order. Thanks
to Ethan Smith for the report!

Fixes #422.
  • Loading branch information
joshuaulrich committed Jul 13, 2024
1 parent b8bdf88 commit 6523b54
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -1248,7 +1248,8 @@ new.replot_xts <- function(panel=1,asp=1,xlim=c(1,10),ylim=list(structure(c(1,10
if(lim[1L] == 0) {
lim <- c(-1, 1)
} else {
lim <- lim[1L] * c(1 - const_y_mult, 1 + const_y_mult)
adj <- sign(lim[1L]) * const_y_mult
lim <- lim[1L] * c(1 - adj, 1 + adj)
}
}

Expand Down

0 comments on commit 6523b54

Please sign in to comment.