1

I am scaling x axis with following code.

 > scale_x_continuous("", limits = c(0.1, 10), breaks = c( .1, .2, .4,.67, .8, 1, 1.25, 1.5, 2.5, 5, 10))

But in the plot, numbers overlaps with one another (see the pic: points 0.67 to 1.25). To avoid this overlap, I want the control decimal for points 0.67 to 1.25. I want to keep,2 decimals from .67 and 1.25, one decimal places for .8 and no decimal for 1.

Basically, I want to show the numbers like this: .1,.2,.4,.67,.8,1,1.25,1.5,2.5,5,10. How can I do that?

enter image description here

Dennis Kozevnikoff
  • 2,078
  • 3
  • 19
  • 29
Tashaho
  • 163
  • 1
  • 2
  • 11

1 Answers1

1

Just set the labels= as well. You can put whatever value you want there.

scale_x_continuous("", 
  limits = c(0.1, 10), 
  breaks = c( .1, .2, .4,.67, .8, 1, 1.25, 1.5, 2.5, 5, 10),
  labels = c( ".1", ".2", ".4" , ".67", ".8", "1", "1.25", "1.5", "2.5", "5", "10"),
)
MrFlick
  • 195,160
  • 17
  • 277
  • 295
  • It solved most of the overlap. However, in the new plot 1.25 and 1.5 are very congested. How can solve that? Any solution? – Tashaho Jul 14 '20 at 20:15