Developing a publish quality proportional stacked bar graph
In order to develop a publish quality proportional bar graph, this recipe will produce a figure similar to the one produced at Recipe Crafting a proportional stacked bar graph. The only difference is that this time we will aim for publishing quality. The way we do this is by: manually setting color; reworking labels' content and sizes; and reworking legends and axes. Let's begin by looking at the requirements.
Getting ready
Apart from packageggplot2
the only required package will be car
package. Run the following code if you are not sure about having this last package already installed:
if( !require(car)){ install.packages('car')}
Do not forget that internet connection is needed. Now let's draw.
How to do it...
The bar proportional bar chart will be produced in a iterative way. After each step you can check the changes made by the step by calling the object created by the particular step (h<step number>
):
- We start by loading the...