Skip to main content

All Questions

Tagged with
1 vote
1 answer
29 views

Showing or saving only the legend of a plotly figure

Given a plotly figure with traces and a legend, is there a way to only show the legend without any of the plot content? My use case for this: I'm exporting several images with the same legend. Instead ...
william_grisaitis's user avatar
0 votes
1 answer
53 views

Add size legend to plotly.express.scatter_mapbox

I have a visualization done using plotly.express.scatter_mapbox. It basically shows the different institutions on the Saudi Arabia map. These institutions are marked by small circles that are color ...
Kareem's user avatar
  • 1
0 votes
1 answer
40 views

How to prevent hiding plotly chart bar on chart legend click

How to prevent hiding plotly chart bar on chart legend click in an angular application. <plotly-plot [divId]="graph.selectedGraph.name" [data]="graph.selectedGraph....
vijesh's user avatar
  • 1,163
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
0 votes
1 answer
40 views

Change layout of legend2 in plotly

How to change layout of legend2 with fig.update_layout()? import plotly.express as px import pandas as pd numbers = pd.DataFrame([[1,2,3,4], [2,3,4,5], [5,7,8,8]]) asdf = px.line(numbers) asdf = asdf....
Václav Bočan'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
1 vote
1 answer
80 views

plotly title_side position not working properly

I'm greenhand with Python plots but I was trying to do a PCA for different human populations; while I'm still working on the actual data, the main issue I'm having with visualizations in Python, as ...
Matteo's user avatar
  • 209
0 votes
0 answers
21 views

plotly express legend not responsive to any attempt at adjustment (including complete removal)

I am doing a visualization for a paper im writing about differences in specific stances between men and women. In order to do this, i want to create a plotly figure with 4 subplots. This worked great, ...
GuyBecker's user avatar
1 vote
0 answers
18 views

Legend repeatition for scatter subplots in poltly express

I have a dataframe and I have plotted four different columns of the dataframe each with a 5th column and colour them based on a 6th categorical column as subplots in the same figure. I want to have ...
Alexandra Payne's user avatar
0 votes
1 answer
57 views

Legend and labels for Plotly express line graph

I want to draw a three graphs on one x-y axes using Plotly.express. I've read a CSV file of monthly returns using pandas, and have a pandas dataframe containing four series: Date, IRA, MSCI and SnP. I ...
The Buggser's user avatar
0 votes
0 answers
53 views

Imshow Plotly colour toggling using legend

I'm currently working on a data visualisation using Plotly in Python, and I've hit a bit of a roadblock. I have a 2D array representing image data, and I'm using plotly.express.imshow to display it. ...
Vitto Titto's user avatar
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
0 votes
0 answers
108 views

Python plotly animated scatter plot, show all colours on the legend

Hi all, I have a plotly animated chart where the colour of the chart changes based on a discreet value in the "Vol" column. However the legend on the left only shows one colour on the chart ...
user2461546's user avatar
0 votes
2 answers
289 views

How to fix the legend of plotly 3D scatter plots in Python?

I am trying to create some 3D scatter plots using plotly in Python. I have a data frame with some personality traits and cluster labels, and I want to plot the TSNE embeddings for each trait using ...
DavidS's user avatar
  • 77
1 vote
1 answer
199 views

how to manage legend_tracegroupgap for different row_heights in subplots in plotly?

i found this example code for subplot with legend at each subplot. i changed it by adding row_heights and now the legend do not fit to the subplots. import pandas as pd import plotly.express as px df ...
Alex's user avatar
  • 1,081
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
0 votes
1 answer
293 views

Legend doesn't show up in Plotly Express line subplots

There are several answers for showing the legend if you're using plotly.graph_objs. I'm only using plotly_express though, and can't get the legend to show up when using several subplots. I have the ...
Jakob's user avatar
  • 843
0 votes
1 answer
76 views

Related to legends for subplots in plotly

I have created the 4 subplots with the legends showing on right sideWhen I create subplots in plotly , legends are created either in right side or in the bottom of all subplots. But how can I get ...
Rajesh Koyi's user avatar
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
0 votes
1 answer
62 views

Is there a way to set the color of plotly legend items?

I want to visualize multiple boolean arrays using Scatter traces with timestamps as x and the array-index as y. The values should be visualized using the colors. However, what I do not like is that ...
KrawallKurt's user avatar
3 votes
1 answer
198 views

A legend marker for each unique texture in the same bar trace, with Plotly Graph Objects in Python

I have the following code as example: x=[1,2,3,4] y=[2,2,4,3] colors = ["blue","blue","orange","blue"] textures = ["","","x","...
33fred33's user avatar
0 votes
1 answer
175 views

Plot multiple y-axis and colors but a single x-axis

I'm trying to plot 4 types of data on a single graph using plotly. they all share the x-axis but one of them has a different y-axis to it, I want to plot the first few categories which share the x and ...
Tomer Gigi's user avatar
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
1 vote
1 answer
5k views

How to change the size of legend box in Plotly?

It is my code below: import plotly.graph_objects as go fig = go.Figure() for i in range(100): fig.add_trace(go.Scatter( x=[1,2], y=[1,2], name = f'{i}'*20, ...
ChienHua's user avatar
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
0 answers
201 views

Make legend horizontal and reduce the size in Plotly Dash

I am trying to make the attached legend horizontal and smaller in size but it's not working. Also if you see the Plot is hidden below the legend. (Some states are not visible) How can I set that to ...
Himanshu Joshi's user avatar

15 30 50 per page
1
2 3 4 5 6