所以我写了一个闪亮的应用程序,用于导入数据并使用ggplot2绘制它。如果我使用cairo进行绘图
options(shiny.usecairo=T)
(默认情况下应该处于活动状态)图表更漂亮但是 y轴标签"耗氧量" 错过了某些部分。
没有开罗的情节:
用cairo绘图:
有人能指出我的解决方案或有想法是什么错误?
编辑:这是一个最小的例子:
library(shiny)
library(ggplot2)
options(shiny.usecairo=T)
# Define UI for application that draws a histogram
ui <- fluidPage(
# Application title
titlePanel("Old Faithful Geyser Data"),
# Sidebar with a slider input for number of bins
sidebarLayout(
sidebarPanel(
sliderInput("bins",
"Number of bins:",
min = 1,
max = 50,
value = 30),
sliderInput("size",
"size:",
min = 0.1,
max = 40,
value = 15)
),
# Show a plot of the generated distribution
mainPanel(
plotOutput("distPlot")
)
)
)
# Define server logic required to draw a histogram
server <- function(input, output) {
res<- reactive({input$resolution})
output$distPlot <- renderPlot({
#refresh on
print(input$resolution)
# generate bins based on input$bins from ui.R
x <- faithful[, 2]
bins <- seq(min(x), max(x), length.out = input$bins + 1)
# draw the histogram with the specified number of bins
qplot(x, breaks = bins, col = 'darkgray', ylab = "Some long string to test for errors and see what is affected")+theme_classic(base_size=input$size)
})
}
# Run the application
shinyApp(ui = ui, server = server)
所以,对我来说,看起来右边的某些角色被削减了。
编辑:我把它缩小到我的Windows机器,不能再在shinyapps.io和本地linux服务器上看到了。可能不那么相关,因为错误只发生在开发过程中。