slowkow / ggrepel

:round_pushpin: Repel overlapping text labels away from each other in your ggplot2 figures.
https://ggrepel.slowkow.com
GNU General Public License v3.0
1.21k stars 95 forks source link

geom_text() is working but not geom_text_repel #214

Closed rpbajpai closed 2 years ago

rpbajpai commented 2 years ago

Summary

This sentence briefly summarizes the issue.

Minimal code example

my data frame has following struture

str(dgg) 'data.frame': 24 obs. of 4 variables: $ shape : num 0.096 0.212 0.201 0.096 0.105 0.363 0.305 0.098 0.089 0.197 ... $ n0 : int 27151 20969 21145 28310 28557 25350 25075 26782 26997 22208 ... $ state : chr "Noninfected_1" "Noninfected_1" "Noninfected_1" "Noninfected_1" ... $ signal: chr "N11" "N12" "N13" "N14" ... The following code plots graph ggplot(dgg,aes(x=shape,y=n0,color=state,label=signal))+geom_text() but the code with repel ggplot(dgg,aes(x=shape,y=n0,color=state,label=signal))+geom_label_repel() gives the error Error in grid.Call(C_convert, x, as.integer(whatfrom), as.integer(whatto), : Viewport has zero dimension(s)

Suggestions

I tried many things but nothing works.

Version information

I am using latest version of ggrepel from the git hub Here is the output from sessionInfo() in my R session:

Error in grid.Call(C_convert, x, as.integer(whatfrom), as.integer(whatto),  : 
  Viewport has zero dimension(s)
slowkow commented 2 years ago

Please see the discussions about this issue here: