Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upHandling of empty strings #51
Comments
|
Thank you for describing the issue and providing images! I like your suggestion! This merits a detailed example in the documentation to make sure users know how to use this feature. If we go ahead with this suggestion, then we'll have 3 possibilities for what happens to a data point:
|
|
To complement this my new stat can reset the labels to "" based on the density of observations. This would take care of the "static" case, not the "reactive" one, which would need to be handled by text_repel and label_repel on the fly. The images above were produced using the following code:
and
In the current version |
fixes issue #51 when a label is the empty string "": - do not draw a text label for it - repel other text labels from the data point labeled by the empty string
|
@aphalo Could I ask you to try 0.6.0? Does this work the way you expect with empty strings? devtools::install_github("slowkow/ggrepel@0.6.0") |
|
@slowkow Yes, indeed! Works nicely. Please find attached my examples above rerun with |
|
Excellent, and thank you very much for sharing the figures. I'm going to add an example like this to the documentation soon. |


I think it would be best to handle "" as a special case, not drawing segments and empty boxes in this case. It would also help in cases when one wants not to label some observations but still have the observations themselves, e.g., points on the plot, as objects to repel from.