子图隐藏着标题以及X和Y图的闪亮
我在闪亮的应用程序上有一些图。 我用情节向他们展示。请查看我的代码的一部分。 如您所见,我为每个图添加了标题,X轴和Y轴标签。但是,当我通过“子图”合并它们时,它隐藏了标签。我需要在页面上同时显示所有图。 我该如何解决?
#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)
})
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)
})
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论