Sometimes, we have a gernal 2D plot with several overalpping labels as an example below:
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt:Age << Label( 1 );
For Each Row( Row State()=Labeled State(1) );
Graph Builder(
Size( 528, 454 ),
Show Control Panel( 0 ),
Variables( X( :weight ), Y( :height ) ),
Elements( Points( X, Y, Legend( 18 ) ) )
);
If we want to keep all the labels in the plot, one possible way is drag the labels to the right place. However, it become more difficalt when the data points are large. is there any possible way we can do as the same in R to repel overlapping text labels using JSL instead of drag the label one by one?
Before After
Reference: https://cran.r-project.org/web/packages/ggrepel/vignettes/ggrepel.html