Skip to content
Prev 385315 / 398502 Next

"patternbar_s" : show legend and other issues

Hi

Probably patternbar handles legend position in nonstandard way so 
lebend.position does not work as expected.

Rotating % is done by axis.title.y ...
theme(axis.text.x = element_text(angle = 90),
axis.title.y = element_text(angle=0),
aspect.ratio= 0.4)

Legend has to be placed probably by legend.y.pos and legend.x.pos.

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,
legend.y.pos = .49, legend.x.pos = 1.1) +
scale_y_continuous(limits = c(0, 150.2))

Cheers
Petr