Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

guide_stringlegend() throws Error in get_layer_key(...) : argument "data" is missing, no default #159

Closed
adcascone opened this issue May 14, 2024 · 4 comments

Comments

@adcascone
Copy link

I tried recreating the second set of plots using the code provided in the "String legends" section of the "Miscellanous" vignette, but guide_stringlegend() throws the following error: Error in get_layer_key(...) : argument "data" is missing, no default

Here is the code I tried:

p <- ggplot(mpg, aes(displ, hwy)) + geom_point(aes(colour = class))
p + guides(colour = guide_stringlegend(face = "bold", spacing = 15))

image

I see that the function's lifecycle is marked as 'questioning' on the function reference site - are there plans to update this function in future package versions?

Thank you!
Arianna C.

@teunbrand
Copy link
Owner

Hi thanks for inquiring!

It seems to be working fine on my end, using ggplot2 3.5.1 and ggh4x 0.2.8.
What version combination of ggplot2 and ggh4x are you using?

are there plans to update this function in future package versions?

No I'm in the process of writing a separate package (gguidance) for guide extensions, where this one will be transferred to.

@adcascone
Copy link
Author

Thanks for the reply - I'm using ggplot2 3.5.1 and ggh4x 0.2.6

And good to know about transferring this function to the new package - I appreciate the insight!

@teunbrand
Copy link
Owner

I'd recommend updating to 0.2.8, there were some breaking changes in ggplot2 that required some adaptation in ggh4x.

@teunbrand
Copy link
Owner

I'm going to go ahead and assume that updating has fixed the issue. I'll reopen if somebody points out I was mistaken.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants