@@ -41,10 +41,8 @@ current.xts_chob <- function() invisible(get(".xts_chob",.plotxtsEnv))
41
41
#
42
42
# * update_panels(): re-calculate the x-axis and y-axis values.
43
43
# * render_panels(): render all the plot panels.
44
- # * get_ylim(): recalculate the ylim for a specific panel.
45
- # * y_grid_lines: function to plot the y-axis grid lines.
46
- # * x_grid_lines: function to plot the x-axis grid lines.
47
- # * yaxis_expr(): create the expression to render the y-axis ticks and labels.
44
+ # * x_grid_lines(): plot the x-axis grid lines.
45
+ # * create_ylim(): create y-axis max/min, handling when max(x) == min(x).
48
46
49
47
# The panel object is composed of the following fields:
50
48
#
@@ -57,10 +55,10 @@ current.xts_chob <- function() invisible(get(".xts_chob",.plotxtsEnv))
57
55
# * actions: a list of expressions used to render the panel.
58
56
# * add_action(): a function to add an action to the list.
59
57
#
60
- # The panel also has expressions for rendering the y-axis min/max values,
61
- # labels, and grid lines/ticks. It also contains an x-axis grid line expression
62
- # because we need the y-axis min/max values to know where to draw the x-axis
63
- # grid lines.
58
+ # The panel has the 'yaxis_expr' expression for rendering the y-axis min/max
59
+ # values, labels, and grid lines/ticks. It also contains the x-axis grid
60
+ # expression because we need the y-axis min/max values to know where to draw
61
+ # the x-axis grid lines on the panel .
64
62
65
63
# Other notes
66
64
#
@@ -994,11 +992,10 @@ new.replot_xts <- function(panel=1,asp=1,xlim=c(1,10),ylim=list(structure(c(1,10
994
992
for (panel_n in seq_along(Env $ panels )) {
995
993
996
994
panel <- Env $ panels [[panel_n ]]
997
- # set the current active panel, so get_ylim() will use it
995
+ # set the current active panel for the entire plot
998
996
Env $ active_panel_i <- panel_n
999
997
1000
998
is_header <- TRUE # header is always the first action
1001
- # panel$render_header(Env$xlim, panel_ymax[panel_n])
1002
999
1003
1000
for (action in panel $ actions ) {
1004
1001
@@ -1320,7 +1317,7 @@ new.replot_xts <- function(panel=1,asp=1,xlim=c(1,10),ylim=list(structure(c(1,10
1320
1317
# some actions (e.g. addLegend) do not have 'xdata'
1321
1318
dat.range <- create_ylim(action_data [Env $ xsubset ])
1322
1319
1323
- # re-retrieve ylim; actions may be changed it
1320
+ # re-retrieve ylim; actions may have changed it
1324
1321
new_ylim <-
1325
1322
c(min(panel $ ylim [1 ], dat.range , na.rm = TRUE ),
1326
1323
max(panel $ ylim [2 ], dat.range , na.rm = TRUE ))
0 commit comments