@@ -164,20 +164,16 @@ CoordTrans <- ggproto("CoordTrans", Coord,
164164 },
165165
166166 render_axis_h = function (panel_params , theme ) {
167- arrange <- panel_params $ x.arrange %|| % c(" secondary" , " primary" )
168-
169167 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 )
172170 )
173171 },
174172
175173 render_axis_v = function (panel_params , theme ) {
176- arrange <- panel_params $ y.arrange %|| % c(" primary" , " secondary" )
177-
178174 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 )
181177 )
182178 }
183179)
@@ -228,12 +224,10 @@ view_scales_from_scale_with_coord_trans <- function(scale, coord_limits, trans,
228224 out $ sec.minor_source <- transform_value(trans , out $ sec.minor_source , out $ range )
229225
230226 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 ),
235230 sec = view_scale_secondary(scale , scale_limits , continuous_ranges $ continuous_range ),
236- arrange = scale $ axis_order(),
237231 range = out $ range ,
238232 labels = out $ labels ,
239233 major = out $ major_source ,
0 commit comments