Skip to content

Legend incorrectly captured #2007

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
danton267 opened this issue Sep 24, 2021 · 2 comments · Fixed by #2067
Closed

Legend incorrectly captured #2007

danton267 opened this issue Sep 24, 2021 · 2 comments · Fixed by #2067
Assignees
Labels

Comments

@danton267
Copy link
Member


library(plotly)
library(ggnet)
library(network)
library(sna)
library(ggplot2)

# random graph
net = rgraph(10, mode = "graph", tprob = 0.5)
net = network(net, directed = FALSE)

net %v% "phono" = ifelse(letters[1:10] %in% c("a", "e", "i"), "vowel", "consonant")


p <- ggnet2(net, color = "phono")

ggplotly(p)

Legend results in (1,contant,19,9) and (1,vowel,19,9) instead of contant and vowel

@moutikabdessabour
Copy link
Contributor

This is caused by ggplotly taking in all the aesthetics even if they have only value. I don't know if this is the correct behavior or not? @cpsievert. I'll have a patch ready by tomorrow morning.

@cpsievert
Copy link
Collaborator

@moutikabdessabour this seems like a tricky issue to fix without introducing other regressions, have you looked into it at all?

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

Successfully merging a pull request may close this issue.

4 participants