Skip to content

Commit

Permalink
Use ylim_render when drawing legend
Browse files Browse the repository at this point in the history
This avoids an error when adding a legend when 'log = TRUE'.

Fixes #407.
  • Loading branch information
joshuaulrich committed Jan 31, 2024
1 parent 9f13600 commit 13701fc
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 @@ -742,7 +742,8 @@ addLegend <- function(legend.loc="topright", legend.names=NULL, col=NULL, ncol=1
if(is.na(on[1])){
yrange <- c(0, 1)
} else {
yrange <- x$get_panel(on)$ylim
panel <- x$get_panel(on)
yrange <- panel$ylim_render
}
# this just gets the data of the main plot
# TODO: get the data of panels[on]
Expand Down

0 comments on commit 13701fc

Please sign in to comment.