2

Does anyone know how to ensure that all the labels fit into the frame or expand the it beyond the chart without having the labels cut off?

Would also love to know how i can adjust the position of the label boxes and if there's any way to wrap text around the box so it's not occupying the entire row.

ggplot(convo4_merge, aes(x=call_record , y=sentiment_score, color = currently_speaking)) +
geom_line() +
ggtitle("Sentiment Analysis for Conversation 4") +
geom_label_repel(data=subset(convo4_merge, sentiment_score >0.85 | sentiment_score < -0.80), aes(label=split_transcript), box.padding =unit(0.5,"lines"), point.padding= unit(0.3, "lines"), segment.size=0.2, segment.color= 'grey50') + theme_classic( )

enter image description here

enter image description here

Kent
  • 21
  • 2
  • 2
    Please provide example data, and code. – zx8754 Jul 01 '20 at 21:01
  • 1
    You could add newlines `"\n"` for every 4th word. Or use str_wrap. see related post: https://stackoverflow.com/q/56028991/680068 – zx8754 Jul 01 '20 at 21:04
  • ggplot(convo4_merge, aes(x=call_record , y=sentiment_score, color = currently_speaking)) + geom_line() + ggtitle("Sentiment Analysis for Conversation 4") + geom_label_repel(data=subset(convo4_merge, sentiment_score >0.85 | sentiment_score < -0.80), aes(label=split_transcript), box.padding =unit(0.5,"lines"), point.padding= unit(0.3, "lines"), segment.size=0.2, segment.color= 'grey50') + theme_classic( ) – Kent Jul 02 '20 at 12:48
  • I have also added how my table / data set looks like. ^ is the code. :) – Kent Jul 02 '20 at 12:51
  • [Add your data and code as text, not images](https://stackoverflow.com/posts/62685234/edit). – zx8754 Jul 02 '20 at 12:53
  • hey, i am still unable to figure out how to add the data in the text. :/ – Kent Jul 05 '20 at 12:57

0 Answers0