I have some plots to show on the shiny app. I used Plotly to show them. please look at a part of my code. As you can see I added the title and x-axis and y-axis labels for each of the plots. But when I merge them by "subplot", it hides the labels. I need to show all plots at the same time on a page. How can I resolve it?
#UI section
plotlyOutput("fancyPlot")
#Server side
output$fancyPlot <- renderPlotly({
# I got E somehow, its my dataset
#I didnt write the lines which I got the other vectors and variables like group1_vectors
for (i in 1: length(s)){
plot1 = ggplot(E, aes(x = group1 , y = group2)) +
labs(title= gene_vectors[i],
x= group1_vectors[i], y = group2_vectors[i])+
geom_point(color='tomato')
plot_list_final[[i]] = plot1
}
plot_list_final = do.call(tagList, plot_list_final)
f = length(s)
p_last <- subplot(plot_list_final[1:f], nrows = f, margin = 0.045) %>%
layout(title = "Plots of selected TFs")
# p_last = p_last + coord_fixed(ratio = 1, xlim = NULL, ylim = NULL, expand = TRUE, clip = "on")
dev.off()
return(p_last)
})