Quantcast
Viewing all articles
Browse latest Browse all 206571

plotly::ggplotly legend titles not centering for a faceted ggplot

I'm trying to turn a ggplot plot into an interactive plotly for an R Markdown HTML presentation.

If 'a' is my ggplot, the important bit of code looks like:

x <- list(title = "Title 1")

y <- list(title = "Title 2")

plotly::ggplotly(a + ylab("") + xlab("")) %>% plotly::layout(xaxis = x, yaxis = y)

I used plotly::layout() as the axes titles I provided in the ggplot plot disappeared/overlapped when ggplotly was applied.

As you can see this gets me most of the way there, but it seems like the axis labels are centered on the top left facet and not the plot as a whole. The plot was faceted very simply with a facet_wrap(~var).

Image may be NSFW.
Clik here to view.
enter image description here

Is there a way to have the axis titles move into the center? (y axis title between the two left hand facets, x axis title under the middle facet)


Viewing all articles
Browse latest Browse all 206571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>