tmap icon indicating copy to clipboard operation
tmap copied to clipboard

legend.is.portrait = FALSE not available for tm_bubble

Open anjelinejeline opened this issue 1 year ago • 1 comments

Hi I would like to have a horizontal legend when using tm_bubble however it seems that the option legend.is.portrait is not available for this function. Is there a workaround to create a horizontal legend with tm_bubble ?
Thanks Angela

anjelinejeline avatar Feb 11 '24 09:02 anjelinejeline

Hi @anjelinejeline, you could try legend.col.is.portrait = T or legend.size.is.portrait = T and see if it takes them. col or size will depend on if the legend is based on the bubble sizes or colors.

aonojeghuo avatar Feb 21 '24 23:02 aonojeghuo

This was not available in tmap3 in view mode. Is that what you are referring to?

Anyway, this is the plot mode in tmap4:

tm_shape(metro) +
    tm_bubbles(size = "pop2020", 
               fill = "pop2010", 
               size.legend = tm_legend(orientation = "landscape", stack = "vertical"),
               fill.legend = tm_legend(orientation = "landscape"))

Created on 2024-03-07 with reprex v2.1.0

and view mode:

Screenshot 2024-03-07 at 15 43 22

mtennekes avatar Mar 07 '24 14:03 mtennekes