Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201839

Change legend symbol "a" with geom_line and geom_point

$
0
0

I have the following data stored in a dataframe called "astatdf2":

sampletype  variable       value
1  tissue_T1   Entropy 11.61460794
2  tissue_T2   Entropy 14.23313815
3  tissue_T1 Clonality  0.09642700
4  tissue_T2 Clonality  0.03835666
5  tissue_T1      Gini  0.61982789
6  tissue_T2      Gini  0.45175592

I am trying to plot these values with different colors using lines and dots. My only problem is the legend. I tried several solutions, looked in google, in stack etc... but none of them works. How do I get rid off the "a" in the legend and replace it with a circular dot?

library(scales)
library(ggplot2)
p=ggplot(astatdf2, aes(x=sampletype, y=value, group=variable, color=variable))+
    geom_line()+
    geom_point()+
    geom_text(aes(label=round(value, 2)),hjust=0.5, vjust=-1)+
    scale_y_log10(
      breaks = scales::trans_breaks("log10", function(x) 10^x),
      labels = scales::trans_format("log10", scales::math_format(10^.x)),
      limits=c(0.01,50) )+
      labs(color="Estimators")

enter image description here


Viewing all articles
Browse latest Browse all 201839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>