ggrepel

Override horizontal positioning with ggrepel

回眸只為那壹抹淺笑 提交于 2019-11-28 08:35:09
问题 I'm working on a chart similar to a slopegraph, where I'd like to put labels along one or both sides with ample blank space to fit them on both sides. In cases where labels are very long, I've wrapped them using stringr::str_wrap to place linebreaks. To keep labels from overlapping, I'm using ggrepel::geom_text_repel with direction = "y" so the x-positions are stable but the y-positions are repelled away from one another. I've also got hjust = "outward" to align the left-side text at its

Label points in geom_point

↘锁芯ラ 提交于 2019-11-26 16:56:16
The data I'm playing with comes from the internet source listed below nba <- read.csv("http://datasets.flowingdata.com/ppg2008.csv", sep=",") What I want to do, is create a 2D points graph comparing two metrics from this table, with each player representing a dot on the graph. I have the following code: nbaplot <- ggplot(nba, aes(x= MIN, y= PTS, colour="green", label=Name)) + geom_point() This gives me the following: What I want is a label of player's name right next to the dots. I thought the label function in ggplot's aesthetics would do this for me, but it didn't. I also tried text()

Label points in geom_point

喜夏-厌秋 提交于 2019-11-26 04:32:23
问题 The data I\'m playing with comes from the internet source listed below nba <- read.csv(\"http://datasets.flowingdata.com/ppg2008.csv\", sep=\",\") What I want to do, is create a 2D points graph comparing two metrics from this table, with each player representing a dot on the graph. I have the following code: nbaplot <- ggplot(nba, aes(x= MIN, y= PTS, colour=\"green\", label=Name)) + geom_point() This gives me the following: What I want is a label of player\'s name right next to the dots. I