# Create data
my_variable=rnorm(2000, 0 , 10)
# Calculate histogram, but do not draw it
my_hist=hist(my_variable , breaks=40 , plot=F)
# Color vector
my_color= ifelse(my_hist$breaks < -10, rgb(0.2,0.8,0.5,0.5) , ifelse (my_hist$breaks >=10, "purple", rgb(0.2,0.2,0.2,0.2) ))
# Final plot
plot(my_hist, col=my_color , border=F , main="每個人的時薪" , xlab="時薪",ylab="人數", xlim=c(-40,40) )