[R] "patternbar_s" : show legend and other issues

John m|@ojpm @end|ng |rom gm@||@com
Tue Aug 18 08:31:30 CEST 2020


Hi

   Thanks for help from people on this forum. My graph (made with
patternbar_s) is attached.

(1) How should I place my legend under the graph? I have "
,legend.position="bottom"" in my theme, but it does not seem to work.
(2) How may I rotate the y label ("%")?

*****
Code:
*****
x<- factor(df_c_m$date)
df_c_m[,"date"]<-x
y<-df_c_m$percentage
group <- df_c_m$direction
patternbar_s(df_c_m, x,y, group, xlab='', ylab='%', label.size=3,
pattern.type=c( 'hlines','nwlines', 'crosshatch'), pattern.line.size=c(5,
5, 5),frame.size=0.2,
             pixel=16, density=c(18, 30, 50),frame.color='black',
              legend.label=c("up", "uc", "dn" ),
             bar.width=0.8)+scale_y_continuous(limits = c(0,
100.2))+ggtitle('')+ theme(axis.text.x = element_text(angle = 90),
aspect.ratio= 0.4 ,legend.position="bottom")
*****
data: attached

-------------- next part --------------
A non-text attachment was scrubbed...
Name: temp200818.pdf
Type: application/pdf
Size: 214674 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20200818/42c5ce52/attachment.pdf>


More information about the R-help mailing list