Resize axis scale step size in ggplot2

i have R geom_tile that generate a geom_tile graph exactly the way I want.

but the problem is that the axis step size is so big eg(4000 - 8000 - 12000 - ...)

I tried scale_x_continuous('Xaxis',limits = c(...)) and scale_x_continuous(breaks=1:10)

but it only limits the data.

What should I do to minimize the size of this step on the axis?

 eg (500 - 1000 - 1500 - 2000 - 2500 ....etc) 

thankk you

+6
source share
1 answer

Since no one has sent a response yet, only comments, here it is :)

 scale_x_continuous(breaks = seq(0, 10000, 500)) 

Source: http://docs.ggplot2.org/current/scale_continuous.html

+11
source

Source: https://habr.com/ru/post/910718/


All Articles