I feel like this should be easy but It's been hours of searching and I can't find anything.
I have a density curve below made with the following code
ggplot()+
geom_density(data = onlyOne, aes(x = log10(frequency), weight = count), bw = 0.2, fill="black", alpha = 0.5)+
geom_density(data = tableOfGraphData, aes(x = log10(frequency.x), weight = count.x), bw = 0.2, fill = "red", alpha = 0.5)+
coord_cartesian(xlim = c(-4, 0))+
theme_light()
I need the figures to have that specific x-axis range but it's driving me nuts that the curves just cut off where their data ends. How do I get the curves to continue to the edge of the figure so that they simply trail off to zero? Theoretically, this would be like having just a bunch of zeros in the data going off to infinity on both sides no?
Does anybody know how to do this?



scale_x_continuous()to make the axis wider than the data range.