Skip to content

Commit

Permalink
Do not overwrite panel's 'ylim' value
Browse files Browse the repository at this point in the history
This was overwriting the panel's 'ylim' value with the value for
'ylim_render', when the value for 'ylim' should be as read-only.
  • Loading branch information
joshuaulrich committed Oct 9, 2023
1 parent 17fac92 commit 0e4d3ed
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions R/plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -1227,12 +1227,14 @@ new.replot_xts <- function(panel=1,asp=1,xlim=c(1,10),ylim=list(structure(c(1,10

if (use_global_ylim) {
# use the ylim based on all panels' data
ylim <- ylim_render
yl <- ylim_render
} else {
yl <- ylim
}

# y-axis grid line locations
grid_loc <- pretty(ylim, Env$yaxis.ticks)
grid_loc <- grid_loc[grid_loc >= ylim[1] & grid_loc <= ylim[2]]
# y-axis grid line labels and locations
grid_loc <- pretty(yl, Env$yaxis.ticks)
grid_loc <- grid_loc[grid_loc >= yl[1] & grid_loc <= yl[2]]

# draw y-axis grid lines
segments(x0 = xlim[1], y0 = grid_loc,
Expand Down

0 comments on commit 0e4d3ed

Please sign in to comment.