r - Horizontally shift boxplot bars' position using ggplot2 -


i need shift bars in boxplot horizontally on plot (left or right). there way can adjust boxplots' x-axis position without changing x-axis?

the code using generate boxplot listed below,

plot <- ggplot(aes(y = score, x = date, fill = category), data = data_r1000)  + geom_boxplot(width=0.8) + ylim(20,100) + labs(title = "us_marketor")  + theme(legend.position="bottom")  + theme(panel.background = element_rect(fill = "transparent",colour = na))  + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank())  + scale_fill_hue(c=50, l=85) 

the results looks thisenter image description here

i have tried using position = position_dodge/position_jitter none of them works. output plot multiple boxplot bars, , have removed background , grids. want shift these bars left side or right side of default position.

add coord_flip() code:

plot <- ggplot(aes(y = score, x = date, fill = category), data = data_r1000)  + geom_boxplot(width=0.8) + ylim(20,100) + labs(title = "us_marketor")  + theme(legend.position="bottom")  + theme(panel.background = element_rect(fill = "transparent",colour = na))  + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank())  + scale_fill_hue(c=50, l=85)  + coord_flip() 

Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -