You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm new to the package, which is GREAT by the way, kudos to all of you!
I use it mainly for the geom_texthline, which is working fine, but I have this warning message in the console every time. In fact, if I try the example of the help page of the function, I get the same warning message (which is same same warning you have here in github: https://github.com/AllanCameron/geomtextpath?tab=readme-ov-file#reference-lines):
> ggplot(mtcars, aes(mpg, disp)) +
+ geom_point() +
+ geom_texthline(yintercept = 200, label = "displacement threshold",
+ hjust = 0.8, color = "red4") +
+ geom_textvline(xintercept = 20, label = "consumption threshold", hjust = 0.8,
+ linetype = 2, vjust = 1.3, color = "blue4") +
+ geom_textabline(slope = 15, intercept = -100, label = "partition line",
+ color = "green4", hjust = 0.6, vjust = -0.2)
Warning messages:
1: In geom_texthline(yintercept = 200, label = "displacement threshold", :
All aesthetics have length 1, but the data has 32 rows.
ℹ Did you mean to use `annotate()`?
2: In geom_textvline(xintercept = 20, label = "consumption threshold", :
All aesthetics have length 1, but the data has 32 rows.
ℹ Did you mean to use `annotate()`?
Would be great to not have a warning message! Many thanks!
The text was updated successfully, but these errors were encountered:
Yes, this is not really a geomtextpath issue; it is new behaviour in the latest version of ggplot2, and it is a good thing. You would get the same warning if you change geom_textvline to geom_vline, etc.
The point is that if you add these lines as geom layers rather than annotations, you actually get one line for each row of the data frame. The example on the GitHub was written before the change in ggplot, and was due to my misguided attempt to make the code as succinct as possible.
Whilst it would be possible to "fix" this so that you don't get the warnings, I don't want the behaviour of these geoms to differ from their ggplot equivalents.
I'm new to the package, which is GREAT by the way, kudos to all of you!
I use it mainly for the geom_texthline, which is working fine, but I have this warning message in the console every time. In fact, if I try the example of the help page of the function, I get the same warning message (which is same same warning you have here in github: https://github.com/AllanCameron/geomtextpath?tab=readme-ov-file#reference-lines):
Would be great to not have a warning message! Many thanks!
The text was updated successfully, but these errors were encountered: