geom_bar与position参数
geom_bar
默认
The stacking is performed automatically by the position adjustment specified by the position argument. If you don’t want a stacked bar chart, you can use one of three other options: "identity", "dodge" or "fill".
-
position = "identity" will place each object exactly where it falls in the context of the graph. This is not very useful for bars, because it overlaps them. To see that overlapping we either need to make the bars slightly transparent by setting alpha to a small value, or completely transparent by setting fill = NA.
position="identity" -
position = "fill" works like stacking, but makes each set of stacked bars the same height. This makes it easier to compare proportions across groups.
position="fill" -
position = "dodge" places overlapping objects directly beside one another. This makes it easier to compare individual values.
position="dodge"
geom_point作图时注意overplotting问题
position="jitter"