eliocamp / metR

Tools for Easier Analysis of Meteorological Fields
https://eliocamp.github.io/metR/
143 stars 22 forks source link

`geom_text_contour` did not show labels as expected #183

Open wbvguo opened 11 months ago

wbvguo commented 11 months ago

Dear metR developer,

Thanks for maintaining this tool. I was trying to use geom_text_contour but found a small issue. Specifically, when I use

+ geom_text_contour(aes(z = sd, label = after_stat(level)),  color = "black", breaks = seq(0, 0.16, 0.01)) 

I got the following figure, where there are 2 labels on the top contour and they are overlapped image

I want each contour level to have one single label, so I added the label.placer = label_placer_n(n=1) arguments, and get the following figure

+ geom_text_contour(aes(z = sd, label = after_stat(level)), label.placer =  label_placer_n(n=1), color = "black", breaks = seq(0, 0.16, 0.01))

image

Somehow it strangely still shows 2 labels on the top contour and changed the position of another label. May I ask if you have any insights about this issue or any suggestions to fix it?

Thanks!