How to Annotate Positive and Negative Values in a barplot

Correctly align annotation on a horizontal barplot with both negative and positive values

In this post, we will learn how to properly annotate a bars barplot, where there are both positive and negative values/bars in ggplot2. In ggplot2, we can use gem_text() with label option to annotate text or bar heights on a barplot easily. However, when we have a barplot that has both positive and negative bars,… Continue reading How to Annotate Positive and Negative Values in a barplot

How to wrap long axis tick labels into multiple lines in ggplot2

Wrapping or Folding long axis tick labels in a ggplot into multiple lines

In this tutorial, we will learn how to wrap really long axis tick labels into multiple lines in R while making plots with ggplot2. A long axis text labels make harder to understand the plot and ofter it overlaps with the neighboring labels and obscuring the labels. Here we will see two different ways to… Continue reading How to wrap long axis tick labels into multiple lines in ggplot2

How to add percentage label on bars in barplot with ggplot2

How to add labels with percentage symbols on barplots in ggplot2

Adding percentage labels or count labels to bars in a barplot can help read the barplot quickly. In this tutorial, we will learn how to add labels with percentage symbol on bars in a barplot made with ggplot2 in R. Loading Packages and Dataset Let us get started by loading packages needed and a dataset… Continue reading How to add percentage label on bars in barplot with ggplot2

How to Color Barplots with R Color Brewer

Color barplot with RColorBrewer palette

In this tutorial we will learn to how to color bars in a barplot using R Color Brewer’s color palettes. R Color Brewer package “RColorBrewer” offers numerous color palettes that are useful in common situations. For example, it gives “Sequential” palette for ordered data, “Diverging” palette for highlighting deviations from baseline and “Qualitative” palette for… Continue reading How to Color Barplots with R Color Brewer

Exit mobile version