You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ggplotly does not support axes on right or top (ggplot 2.2.0) #808
ggplot 2.2.0 newly added right/top axis placements. ggplotly does not currently respect the axis placement set in the ggplot objects in the resultant html
changed the title [-]ggplotly does not support axes on right or top (ggplot 2.2.0[/-][+]ggplotly does not support axes on right or top (ggplot 2.2.0)[/+]on Nov 22, 2016
Scale position is available in ggplot$scales$scales. In the instance posted above it is ggplot$scales$scales[[2]]$position but I don't know if that's generally true.
ggplot$scales$scales[[1]] tends to be the colour scale (if present) while the others are only present if modified. The quick and dirty solution would be to apply across them and return TRUE if position equals "right" or "bottom" but this is not robust
Activity
[-]ggplotly does not support axes on right or top (ggplot 2.2.0[/-][+]ggplotly does not support axes on right or top (ggplot 2.2.0)[/+]alanocallaghan commentedon Nov 22, 2016
This should simply involve checking the axis position in the ggplot object and changing the axis position in the ggplot object appropriately:
https://community.plot.ly/t/move-axis-labels-to-top-right/534
Scale position is available in
ggplot$scales$scales. In the instance posted above it isggplot$scales$scales[[2]]$positionbut I don't know if that's generally true.alanocallaghan commentedon Nov 23, 2016
ggplot$scales$scales[[1]] tends to be the colour scale (if present) while the others are only present if modified. The quick and dirty solution would be to apply across them and return TRUE if
positionequals "right" or "bottom" but this is not robustalanocallaghan commentedon Nov 23, 2016
Pulling in the information itself is trivial during ggplotly, eg:
However, this does not affect the output (the y-axis is not shown if side==="right")
alanocallaghan commentedon Nov 23, 2016
Actually, on further testing, this fix may work. I will try some extra testing and submit a PR if needed
yinghawl commentedon May 10, 2024
@alanocallaghan I wonder if the fix has been put in place.
alanocallaghan commentedon May 10, 2024
Doesn't look that way to me