r - Strange behaviour of ternary plot in shiny app -


i want include ternary plot in shiny app. i'm use package ggtern.

when run following code:

dd <- data.frame(x=c(3,1,5), y=c(45,29,10), z=c(10,45,94),                 ss=c(58,75,109))  ggtern(data=dd,          aes(x=x,y=y,z=z)) +   geom_mask() +   geom_point() +   larrowlab("var1") + tarrowlab("var2") + rarrowlab("var3") +   theme_showarrows() +   theme(tern.axis.arrow.show=t)#,           #tern.axis.text.show=f) 

i get:

enter image description here

inside shiny app:

library(ggtern) library(shiny) ## data #### dd <- data.frame(x=c(3,1,5), y=c(45,29,10), z=c(10,45,94),                 ss=c(58,75,109)) ################ runapp(    ## ui ####   list(ui = (basicpage(     headerpanel("ternary test"),     mainpanel(       plotoutput("gg", click = "plot_click")     )   )),    ## server ####   server = function(input, output) {      output$gg <- renderplot({        ggtern(data=dd,              aes(x=x,y=y,z=z)) +       geom_mask() +       geom_point() +       larrowlab("var1") + tarrowlab("var2") + rarrowlab("var3") +       theme_showarrows() +       theme(tern.axis.arrow.show=t)#,               #tern.axis.text.show=f)     })    }   )) 

i this:

grafico

why differences? bug? anyway around it?

thanks, antónio


Comments