-
Notifications
You must be signed in to change notification settings - Fork 633
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
legend.position always 'right' in ggplotly, except when legend.position = 'none' #1049
Comments
Same problem.. I tried to set legend argument in ggplotly() but it doesn't work either |
you would need to set the legend orientation option in the
However, there are some limitations with this option as it does not automatically wrap the legend as ggplot does. This will cause legend with a large number of items or long names to be cut off. You can see this issue for more information. It seems that they implemented some kind of fix for this problem in the As a side note, you will likely have to play around with the positioning of the legend in the layout. You will need to set the
Check out their legend options to see what these arguments can be set to. |
Hi, I did this for a similar issue but puts the legend at the top of the plot. I tried fixing this by doing something like |
If you look at the legend layout options, it says that the |
Hi, I am having issues getting the suggested solution to work. Adding the layout seems to be ignored. I may be missing something obvious here, but I have been fiddling with it for some time. I've tried various x and y values as well as specifying only the orientation and vice versa. Example:
Which produces the following:
Session information: |
In response to @seabbs post, it seems like the problem occurs only for continuous variables. When using the transmission variable for the colour aesthetic (and converting it to factor), the
|
In plotly.js, |
…legend.direction=...), closes #1049
…legend.direction=...), closes #1049
…legend.direction=...), closes #1049
…legend.direction=...), closes #1049
When plotting a ggplot object using
ggplotly
,legend.position
is always'right'
even if I choselegend.position = 'top'
or any of the other options. It only works as it is supposed to when I specifylegend.position = 'none'
that it actually disappears.ggplot
displays the legend fine.When I try this instead:
I get the legend on the right, as I show in this shiny app.
The text was updated successfully, but these errors were encountered: