How can I adjust the start of geom_freqpoly to the minimum on the x-axis?

19 Views Asked by At

I have a dataset containing about 20000 depressions with a certain area. I want to make a frequency plot in R with both x-axis and y-axis logaritmic. The minimum area is 1000 m², and so is the minimum on the x-axis. So far this is my code:

ggplot(data, aes(x = area)) +
  geom_freqpoly(bins = 50, size = 1) +
  scale_y_log10() +
  scale_x_log10(breaks = c(1000, 10000, 100000, 1000000), labels = c("1000", "10000", "100000", "1000000")) +
  labs(x = "Depression area (m²)", y = "Number of depressions (N)") +
  theme_classic()+
  theme(axis.title=element_text(size=17), 
        axis.text=element_text(size=14))

This gives the plot below:

frequencyplot

As you can see, the curve starts from before 1000 m², but I don't want that. I want to keep the freqpoly, I want no histogram, it has to be a line. This line has to start from 1000m² of course. How can I manage this? I already tried coord_cartasian, but that also doesn't seem to work.

0

There are 0 best solutions below