New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
showtext, ggplot2 and shinyapps #6
Comments
Hi Bing, |
library(shiny);library(ggplot2);library(showtext) ui <- shinyUI(fluidPage( server <- shinyServer(function(input, output) { |
It works on my machine. Did you forget to library(shiny);library(ggplot2);library(showtext)
ui <- shinyUI(fluidPage(
titlePanel("Old Faithful Geyser Data"),
sidebarLayout(
sidebarPanel(
sliderInput("bins", "Number of bins:", min = 1, max = 50, value = 30) ),
mainPanel(plotOutput("distPlot"))
)))
server <- shinyServer(function(input, output) {
output$distPlot <- renderPlot({
showtext.begin()
g = ggplot(data = faithful, aes(x = eruptions)) +
geom_histogram(bins = input$bins) +
ggtitle("直方图") +
theme_bw(base_size = 30, base_family = "wqy-microhei")
print(g)
showtext.end()
})
})
shinyApp(ui = ui, server = server) |
Thanks! I had solved the problem using the way! |
Great! Then I'll close this issue. |
Thanks for you showtext package. Recently, i want to use the WenQuanYi Micro Hei to show Chinese characters in my figures. After loading the font using the codes
font.add("wqy", regular = "wqy-microhei.ttc")
, the Chinese characters will show well in the figures created by the basic figure system but not for that created by the ggpplot2 package( set using the codes: theme_bw(base_family="wqy")) after publishing to the shinyapps.How could i solve the problem? Thanks
The text was updated successfully, but these errors were encountered: