Skip to content

ggplotly: geom_path interpretation of size #340

Open
@davidaknowles

Description

@davidaknowles

For a visualization I'm making thick curves as follows:

require(ggplot2)
require(plotly)
require(Hmisc)
len=100
edge=data.frame(bezier(x=c(0, 1, 2), y=c(0, 1, 0),evaluation = len))
edge$Sequence <- sin( seq(0,pi,length.out=len) ) 
gg = ggplot(edge,aes(x = x, y = y, size = Sequence)) +  geom_path() + scale_size( range = c(.3, 20), guide = F) + theme_bw(base_size = 16) + ylim(0,.6) + scale_alpha(guide=F)
pl <- ggplotly(gg)

which in ggplot2 gives:
image

but which with ggplotly

pl <- ggplotly(gg)

gives
image

I think the problem is that ggplotly is assuming every different "size" should be considered as a separate path, whereas ggplot2 is not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions