Closed davidhodge931 closed 4 months ago
Fixed in 48.6
Works awesome when legend is on right.
Could this work when the legend is on the top or bottom?
Yes. That will require a little bit of work since R flattens the legend when is top or bottom. Example?
I used an example in your website
penguins |>
gg_histogram(
x = flipper_length_mm,
col = species,
title = "Penguin flipper length by species",
subtitle = "Palmer Archipelago, Antarctica",
caption = "Source: Gorman, 2020",
mode = light_mode_t(),
) +
labs(colour = NULL, fill = NULL)
When I inspect the ggplot object the theme for the legend justification is legend.justification" = c("0", "0.5")
This is the plot I get with CanvasXpress. Perhaps I don't understand the way the justification is set. Does this mean align the legend to 50% of the width? Could you help my understanding. I see your plot that the legend is all the way to the left.
I just released version 48.7. Please check and close issues as needed
legend.justification element 1 refers to the hjust between 0 (left) and 1 (right).
legend.justification element 2 refers to the vjust between 0 (bottom) and 1 (top).
I use c(0, 1) for my *_mode_r
theme with the legend on right, and c(0, 0.5) for the *_mode_t
and *_mode_b
one.
Cool, you are using ggblanket! Now you can see where my questions are coming from :)
Also, there is theme(legend.location = "plot")
or theme(legend.location = "panel")
to consider to.
This says whether to consider the legend justification with regard to the plot or panel.
I use panel for my *_mode_r
themes and plot for my *_mode_t
and *_mode_b
themes
Ok So there are pretty much binary for the x coordinate yes or no?
Here are another two plots I am fixing in the next release ;-)
They don't work in the current version :-(
legend.justification element 1 refers to the hjust between 0 (left) and 1 (right).
legend.justification element 2 refers to the vjust between 0 (bottom) and 1 (top).
I use c(0, 1) for my
*_mode_r
theme with the legend on right, and c(0, 0.5) for the*_mode_t
and*_mode_b
one.Cool, you are using ggblanket! Now you can see where my questions are coming from :)
I want you to use CanvasXpress :-)
They are any decimal between 0 and 1 (e.g. 0.86)
Fixed in version 48.9. Can you provide an example with vertical justification when the legend is right or left. Thank you.
penguins |>
gg_histogram(
x = flipper_length_mm,
col = species,
title = "Penguin flipper length by species",
subtitle = "Palmer Archipelago, Antarctica",
caption = "Source: Gorman, 2020",
)
Thank you
Looks pretty good. Perhaps the alignment looks slightly too low?
histogram is dropping the legend title
Fixed in Version 49.1
I want to be able to put the legend top-right, top-left or bottom-left as the alignment looks good