Top "Ggplot2" questions

ggplot2 is an actively maintained open-source chart-drawing package for R, written by Hadley Wickham, based upon the principles of "Grammar of Graphics". It partially replaces R's basic plot and the lattice package, while providing a clean, powerful, orthogonal and fun API.

How to combine 2 plots (ggplot) into one plot?

By using R, is it possible to place 2 ggplot together (i.e., on the same plot)? I wish to show …

r graph plot ggplot2 visualization
How to draw an empty plot?

I need to make an empty plot. This is the best could I come up with. plot(0, xaxt = 'n', yaxt = …

r ggplot2 plot
Plot multiple lines in one graph

Trying to use ggplot to plot multiple lines into one graph, but not sure how to do so with my …

r ggplot2 linegraph
Changing fonts in ggplot2

Once upon a time, I changed my ggplot2 font using using windowsFonts(Times=windowsFont("TT Times New Roman")) to change …

r ggplot2 fonts extrafont showtext
Emulate ggplot2 default color palette

What function can I use to emulate ggplot2's default color palette for a desired number of colors. For example, …

r ggplot2
How do I change the formatting of numbers on an axis with ggplot?

I'm using R and ggplot to draw a scatterplot of some data, all is fine except that the numbers on …

r ggplot2
What do hjust and vjust do when making a plot using ggplot?

Every time I make a plot using ggplot, I spend a little while trying different values for hjust and vjust …

r plot ggplot2
Subset and ggplot2

I have a problem to plot a subset of a data frame with ggplot2. My df is like: df = data.…

r ggplot2 subset
Force the origin to start at 0

How can I set the origin / interception of the y-axis and x-axis in ggplot2? The line of the x-axis should …

r plot ggplot2 axes
Persistent invalid graphics state error when using ggplot2

I believe my dataframe is okay and my code is okay. In fact, I have eliminated parts of the dataframe …

r ggplot2