Skip to content

ggplotly: geom_path interpretation of size #340

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

Open
davidaknowles opened this issue Dec 11, 2015 · 1 comment
Open

ggplotly: geom_path interpretation of size #340

davidaknowles opened this issue Dec 11, 2015 · 1 comment
Labels

Comments

@davidaknowles
Copy link

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.

@cpsievert cpsievert added the bug label Dec 12, 2015
@cpsievert
Copy link
Collaborator

Here is an even more minimal example:

g <- ggplot(economics, aes(date, unemploy, size = pop)) + geom_line()
ggplotly(g)

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

No branches or pull requests

2 participants