Is there anything that can be done to resize the items (specifically the ID color boxes, not the font) displayed in my legend when creating a figure? When I try to export images at high resolutions, the legend winds up being much too small.
Realize I posted a similar question pertaining to choropleth figures the other day, but I’d be happy with even a generalist solution.
Hmmm, it seems the issue is that when the legend items are squares (rather than lines), width simply adds a bunch of white space on either side. Is there anything to enlarge?
Interesting! I’m hoping that because I’m working with choropleths, marker size may not affect the actual chart but still affect the legend. Thanks for your help!
+1 Would be great if legends could be increased/decreased in size independently of the rest of the figure. I am currently exporting a PDF and then change the legend size with Adobe Illustrator.
Yeah, I find it very frustrating that there is no way to adjust legend size without changing the trace size (which I’ve found can’t be done with choropleths angways). I suppose it’s not a huge problem when working with svgs, but Mapbox choropleths in particular don’t appear to vectorize properly so scaling creates a blurry mess. Hopefully that functionality comes at some point.
Frustrating indeed, in my case I have a bubble charts where the bubble area is defined by a column of my dataframe.
And I get the same kind of result as @windrose.
My audience is >50 y.o, they keep asking for larger symbols and legends…
I dont know if it will help, I have a similar problem and it didn’t help either.
overwrite (bool) – If True, existing properties will be overwritten. If False, recursively apply updates to existing properties, retaining properties that are not specified in the update operation.
sorry, I am lost… I did that and it doesn’t work, I am no very nice in coding… i read the github and I don’t understand the solution…
The legend item are too little, my code is that …
Update layout with adjusted legend item width
fig.update_layout(
plot_bgcolor=‘#F8F0EB’,
width=3508,
height=2480,
font=dict(
size=50 # Adjust the font size as needed
),
legend=dict(
font=dict(size=50), # Adjust the legend font size as needed
itemsizing=‘trace’, # Maintain constant legend item size
)
)