Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
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
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
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
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 vote
1 answer
51 views

I cannot add source to this chart, nor can I remove legend title

I have created a simple interactive chart, of Brazil bank NPLs (no longer interactive as saved as a png) using the below code, but need to refine the aesthetics a bit more to exclude the legend title (...
vgall's user avatar
  • 11
3 votes
2 answers
2k views

Plotly subplots - legend item next to its plot [duplicate]

When using plotly subplots, here's a typical example (from https://plotly.com/python/subplots/): from plotly.subplots import make_subplots import plotly.graph_objects as go fig = make_subplots(rows=3,...
Ken Williams's user avatar
  • 23.6k
0 votes
0 answers
731 views

Hide a specific legend in scale_color_manual() when using plotly() at the end

I have a data frame df.europeCoords which looks like this: And I plot a Europe map with the following code: ## Plot the map: ## p <- ggplot(data = df.europeCoords, aes(x = longitude, y = ...
Miko's user avatar
  • 486
0 votes
0 answers
100 views

ggplot legend in R is showing extra dates between the only 2 dates in my data

First question here and couldn't find an answer online. I am comparing values (value at risk) between two dates, February 3, 2020 and January 21, 2020 across a few variables (trading strategies). In ...
ArtieficialLee's user avatar
3 votes
1 answer
3k views

Arrange 4 plotly pie graphs in R

I have four separate pie graphs all with the same specified color scheme (the code is identical apart from the dataframe). The colors are designated because I want to combine them in the 4 grid ...
user avatar
4 votes
2 answers
826 views

Controlling the shared legend when adding a ggplot dendrogram plot to a plotly heatmap

I have genes x samples expression data I'd like to generate a plotly heatmap for and add the samples dendrogram ggplot to. Here are my data: set.seed(1) mat <- matrix(rnorm(100*10),100,10,...
dan's user avatar
  • 6,242
6 votes
1 answer
984 views

extra variables in legend when wrapping ggplot2 in plotly R

I am having trouble making the legend of the following ggplot wrapped in ggplotly() show only one aesthetic. It currently shows three variables (shape, color, linetype) for each legend entry, but I ...
Devri A's user avatar
  • 63
3 votes
1 answer
5k views

Changing legend labels in ggplotly()

I have a plot of polygons that are colored according to a quantitative variable in the dataset being cut off at certain discrete values (0, 5, 10, 15, 20, 25). I currently have a static ggplot() ...
user avatar
4 votes
0 answers
450 views

in R, creating multi column legend in ggplotly

How do you spread a legend over multiple columns in ggplotly? The answer here makes it obvious how to do so using ggplot() - however that code doesn't seem to work when I use ggplotly() library(...
val's user avatar
  • 1,689
1 vote
0 answers
498 views

Plotly - ggplot2 - can't hide repetitive legend text

I'm trying to hide what have become triplicate legend text in plotly using ggplot2. When I render the graph in ggplot, the legend is gone (as I would expect with my code). When I render the graph in ...
bski's user avatar
  • 33

15 30 50 per page