
上QQ阅读APP看书,第一时间看更新
Using more suitable colors for geom_dotplot
Speaking about ggplot2 dot plots, there is a sort of a hacking solution to avoid colored points to overlay one another: manually setting up a vector of colors. However, creating such a vector wouldn't be enough, it has to be ordered properly or else a very wrong result shall be outputted. This recipe sticks with the Salaries data set framework in order to demonstrate how dots can be colored this way.