Skip to content

geom_path cannot be coloured #1294

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

Closed
devktpx opened this issue Jun 27, 2018 · 1 comment
Closed

geom_path cannot be coloured #1294

devktpx opened this issue Jun 27, 2018 · 1 comment

Comments

@devktpx
Copy link

devktpx commented Jun 27, 2018

I have a shiny app with server.R and ui.R.

This is the code in server.R:

library(shiny)
library(ggplot2)
library(plotly)

server <- shinyServer(function(input, output, session) {

dat=data.frame(mycolA=c(1,2,3,4), mycolB=c(12,13,16,10), mycolC=c(330,510,290,530))

    p=ggplot(dat,aes(x=mycolB, y=mycolC)) +
    geom_path(aes(colour=mycolA)) # <----------------------------------
    #geom_path() 

    output$myggplotwithplotly=renderPlotly({
    p
    })

    output$myggplotonly=renderPlot({
        p
    })

})

This is the code in ui.R:

library(shiny)
library(ggplot2)
library(plotly)

ui <- shinyUI(fillPage(
fillRow(
plotlyOutput("myggplotwithplotly", height="100%"), plotOutput("myggplotonly", height="100%")
  )

))

It returns:

plotly

As you see, there is no line at all in plotly.

(See also stackoverflow)

By the way: Arrows are not shown either. The following code works for shiny (only) but not for plotly:
geom_path(size=1,aes(colour=mycolA), arrow = arrow(type="closed", length = unit(0.1, "inches")))

@cpsievert
Copy link
Collaborator

Duplicate plotly/plotly.js#147 #469

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants