Skip to main content

All Questions

Tagged with
0 votes
1 answer
40 views

How to reverse legend order without affecting bar order in Plotly R? [duplicate]

I am creating a stacked bar chart using Plotly in R, and the order of the items in the legend is the reverse of the order that I want. library(dplyr) library(plotly) library(forcats) set.seed(1) df &...
Ernest Au's user avatar
0 votes
0 answers
41 views

R's plotly ggplotly removing legend from a geom_point

I'm generating a simple geom_point plot with R ggplot2: library(dplyr) library(ggplot2) set.seed(1) df <- matrix(runif(16, 0, 10), nrow = 4, ncol = 4, dimnames = list(paste0("R", 1:4), ...
dan's user avatar
  • 6,242
1 vote
1 answer
105 views

How to customize the legend order for a 3D scatter plot?

I'm trying to generate a 3D scatter plot and the shapes of markers correspond to 'Treatment' (IC, IT, YS), whilst, the colors correspond to 'Time' (0, 2, 4, 6, 12, 24, 48, 72). Everything went well ...
SIV0625TriX's user avatar
0 votes
0 answers
26 views

Entrywidth argument not working in R plotly

I am trying to make an interactive plot with the plotly package. The legend needs to be next to the image and have a certain width. I now have the issue that the default appears to be that the legend ...
Bramminator's user avatar
1 vote
2 answers
60 views

Unwanted characters in GGPlot 2 legend entries for stacked area chart

Good day, I need to prepare a graph showing the proportions of the various biomass components, but it is showing ,1 after each component in the legend in R, Ggplot2. I only want to see the list of ...
Otto_P's user avatar
  • 11
0 votes
0 answers
32 views

Placement of plotly legend labels

Plotly places legend labels to the right of their respective "boxes" by default. If possible, I would like to place the labels below the boxes. I have produced a plotly figure with ...
soran hajo dahl's user avatar
1 vote
0 answers
56 views

Add a legend in plotly button graph

With plotly in R, I want to use the buttons to change the data. I've almost managed to make the graph I wanted, except that the legend doesn't appear. I tried adding name = ~B but it doesn't work the ...
nimliug's user avatar
  • 411
1 vote
1 answer
250 views

How to make the legend appear in a stacked bar chart with `plotly` in R

I want to make a stacked bar chart with a slider in plotly. I took inspiration from the plotly website. I can't manage to insert the legend, maybe because I didn't use the legendgroup argument ...
Julien's user avatar
  • 1,664
1 vote
1 answer
132 views

legendrank in R plotly - bug or user error?

I encountered unwanted behaviour using plotly (4.10.1) in R with regards to the order that legends appear. I have raised a formal issue at https://github.com/plotly/plotly.R/issues/2233 ; however I ...
Nir Graham's user avatar
  • 4,767
6 votes
3 answers
1k views

plotly drops grouped legend (by color, by symbol) when converted from ggplot

I don't quite understand why the legend disappeared when I converted a plot made by ggplot to plotly using ggplotly. The plotly help page did not have any information. I don't think their examples ...
Tung's user avatar
  • 27.8k
2 votes
1 answer
91 views

Show single legend for grouped 3D lines in R plotly

The default behavior of plotly is to automagically add several legends when the data is grouped by a variable. In my case, I would like set only one legend despite the group. Is this possible at all? ...
SavedByJESUS's user avatar
  • 3,304
1 vote
1 answer
160 views

Keep colours the same between facetted plots / subplots

Following the R plotly documentation, facetting happens by splitting a dataset on 1 variable, and then applying the same plot function on each split, and finally combining the plots using subplot. If ...
Olsgaard's user avatar
  • 1,438
3 votes
1 answer
726 views

ggplot legend disappears when using ggplotly()

I am trying to keep a legend which is generated when I use ggplot, but upon applying plotly the legend disappears. Here is my code: ggplotchange <- ggplot(data = map.world1, aes(x = long, y = lat, ...
Conor's user avatar
  • 63
-1 votes
1 answer
242 views

Add labels to lines plotly

I needed some help labeling some overlaying lines in plotly. I have a dataframe that consists of the following columns: df$date = c("2014-09-30","2016-03-31","2016-03-31")...
nfalesit's user avatar
  • 115
1 vote
1 answer
4k views

R+Plotly: Customize Legend Entries

I must be having trouble with less than a one liner, but have a look at the snippet below: I cannot the legend option to enter the text that I want in the legend as the name of the species (say, &...
larry77's user avatar
  • 1,461

15 30 50 per page
1
2 3 4 5