@@ -164,20 +164,16 @@ CoordTrans <- ggproto("CoordTrans", Coord,
164
164
},
165
165
166
166
render_axis_h = function (panel_params , theme ) {
167
- arrange <- panel_params $ x.arrange %|| % c(" secondary" , " primary" )
168
-
169
167
list (
170
- top = render_axis (panel_params , arrange [ 1 ], " x " , " top" , theme ),
171
- bottom = render_axis (panel_params , arrange [ 2 ], " x " , " bottom" , theme )
168
+ top = panel_guides_grob (panel_params $ guides , position = " top" , theme = theme ),
169
+ bottom = panel_guides_grob (panel_params $ guides , position = " bottom" , theme = theme )
172
170
)
173
171
},
174
172
175
173
render_axis_v = function (panel_params , theme ) {
176
- arrange <- panel_params $ y.arrange %|| % c(" primary" , " secondary" )
177
-
178
174
list (
179
- left = render_axis (panel_params , arrange [ 1 ], " y " , " left" , theme ),
180
- right = render_axis (panel_params , arrange [ 2 ], " y " , " right" , theme )
175
+ left = panel_guides_grob (panel_params $ guides , position = " left" , theme = theme ),
176
+ right = panel_guides_grob (panel_params $ guides , position = " right" , theme = theme )
181
177
)
182
178
}
183
179
)
@@ -228,12 +224,10 @@ view_scales_from_scale_with_coord_trans <- function(scale, coord_limits, trans,
228
224
out $ sec.minor_source <- transform_value(trans , out $ sec.minor_source , out $ range )
229
225
230
226
out <- list (
231
- view_scale_primary(scale , scale_limits , continuous_ranges $ continuous_range_coord ),
232
- # TODO: currently, view_scale_secondary() requires the range that's not affected by
233
- # the Coord transformation. I'm not yet sure if this is necessary or it's
234
- # just I don't figure out the whole process.
227
+ # Note that a ViewScale requires a limit and a range that are before the
228
+ # Coord's transformation, so we pass `continuous_range`, not `continuous_range_coord`.
229
+ view_scale_primary(scale , scale_limits , continuous_ranges $ continuous_range ),
235
230
sec = view_scale_secondary(scale , scale_limits , continuous_ranges $ continuous_range ),
236
- arrange = scale $ axis_order(),
237
231
range = out $ range ,
238
232
labels = out $ labels ,
239
233
major = out $ major_source ,
0 commit comments