How to prevent R from auto-sizing plots?

156 Views Asked by At

I am making a series of packed circle plots based on my data. I have set all the circles in all of the plots to have the same radius. However, if one of the plots just has a single circle then R will auto-size this circle to take up the entire plot window. Plots that have numerous circles will be auto-sized smaller.

A plot with only 1 circle is auto-sized too large

A plot with multiple circles is auto-sized smaller

My problem is that I want to export all of my packed circle plots and combine them into a larger figure but all of the circles need to be the same size. In the code for these plots all of the circles have the same exact radius. So I believe the problem stems from R auto-sizing the circles for some reason. Is there a way to disable this?

1

There are 1 best solutions below

0
On

Figured out my problem with outside help. I was not manually setting scale_x_continuous() or scale_y_continuous() in ggplot. These parameters were getting filled in by default but whatever R deemed appropriate for each plot. Setting those parameters manually for each plot standardized the size and fixed my problem.