Skip to main content

All Questions

Tagged with
1 vote
1 answer
26 views

How do I make one legend for all subplots in a sns.histplot without duplicate labels?

I have a dataframe that I'm plotting using sns.histplot to make ~9 subplots. I do not want the figure to have 9 legends. I'd like 1 legend for the entire figure, since most of the legends are ...
rcpi's user avatar
  • 51
1 vote
2 answers
42 views

Altair chart legend for subset of data

As an exercise for learning more advanced altair, I'm trying to generate a simplified version of this chart: https://climatereanalyzer.org/clim/t2_daily/?dm_id=world. To simplify, I'm using gray for ...
Don's user avatar
  • 878
1 vote
0 answers
39 views

Text shifted in legend because of LaTeX formatting in matplotlib

For some reason in my subplot, the legend of the second ax is cropped at the bottom inside of the legend box. It seems the index causes the text to shift a bit. The legend box itself is perfectly fine....
Chris Ze Third's user avatar
0 votes
1 answer
42 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
0 answers
19 views

How to keep decimal places in branca colormap using folium?

I'm using branca to create a custom color map to use in a folium map. I would like for the scale to display the decimal places from the index still, not round to a whole numbers, but I'm having a hard ...
megapandalover's user avatar
0 votes
0 answers
37 views

Putting Legend completely outside the plot in right center

I am trying to create a plot where the legend will be in the right center but completely outside the plot. I am following this answer https://stackoverflow.com/a/75453792/3587282 and using Matplotlib ...
melatonin15's user avatar
  • 2,199
0 votes
0 answers
26 views

Dynamic positioning of checkboxes next to chart legend in Plotly Dash

I am currently creating a dashboard with Plotly Dash in Python and have a layout problem that I just couldn't fix over the last couple days: I have a bar chart with a metric, that is always shown and ...
Nimant's user avatar
  • 1
0 votes
2 answers
34 views

2 legends on graph matplotlib [duplicate]

I want to plot a number of curves for different models. I have curves for different structures. The structures need to have the same color and the different models a different linestyle. I then want 2 ...
Loes Vandenbroucke's user avatar
0 votes
0 answers
30 views

Plotting problems in python script vs jupyter notebook

I am encountering issues with my plotting code when running it as a Python script in PyCharm. The plots overlap, and the legends are not displayed, which does not happen when I run the same code in a ...
JuanMuñoz's user avatar
1 vote
1 answer
42 views

How to add legend of plotted line in a box plot?

I have plotted a set of data in a boxplot, and I have added a line in the plot. I want to have the labels of the median and mean in the legend, and I have got it. However, I'm also trying to add the ...
lolloa's user avatar
  • 27
0 votes
0 answers
21 views

Line2D multiple colors in legend [duplicate]

I want to create a custom legend. Here, in the example, I create two lines. But for this line, which now is blue, I would like it to be in multiple colors: blue, green, and red. Here is a minimum ...
blahblah's user avatar
0 votes
0 answers
13 views

Matplotlib not changing legend labels for a plot in python package pyAT

So I am attempting to use a python interface of Accelerator Toolbox (pyAT: link here) to simulate the path of a few particles through an energy spectrometer. From this interface, I've utilized a ...
tfs563's user avatar
  • 1
1 vote
1 answer
58 views

How to make pyplot Hatches look pretty in the legend

I have a problem and struggle to find a solution, or phrase the question for a search engine. I have many python plots where i use hatches to show exclusions from constraints (so some hatches are not ...
TheMaker845's user avatar
1 vote
1 answer
64 views

Why doesn't sns.barplot legend show all values?

I have the following graph. Why does the last graph legend not contain all labels? It should contain these values: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 20, 21] Code: # select only this year ...
John Doe's user avatar
  • 311
0 votes
1 answer
39 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

15 30 50 per page
1
2 3 4 5
73