ggplot wrong color assignment

As you want to supply color names to argument colour= and display also a legend for this argument, you should add scale_colour_identity() to your last line in function. This scale ensures that values supplied will be interpreted as actual color values. Adding of argument breaks=cols_hex in function scale() will ensure ordering of names in legend.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)