4
votes

Due to space constraints on the axes (log-transformed) I would like to only label select breaks while displaying breaks for a continuous sequence. Of course the following results in an error:

scale_x_continuous(breaks=c(-10,0,10,20,30),labels=c(-10,0,10,30))

Error: breaks and labels have unequal lengths

Is there a method to get around this problem?

1
You have 5 breaks, but only 4 labels. Are you trying: scale_x_continuous(breaks=c(-10,0,10,20,30),labels=c(-10,0,10,20,30)) - KFB
Yes, I would like to display 5 breaks on the graph but only label 4 of them - interpost
see if this works: scale_x_continuous(breaks=c(-10,0,10,20,30),labels=c(-10,0,10,"",30)) - KFB
That works perfectly, thank you! - interpost
Just made it as answer. Could you accept it? :) - KFB

1 Answers

7
votes

Please try:

scale_x_continuous(breaks=c(-10,0,10,20,30), labels=c(-10,0,10,"",30))