Is it possible to draw an uneven axis in R? I know that I can specify labels at specific spots, but I mean, I want a particular section of my graph to be spread out. For instance, imagine an X axis such as:
-10 -5 0 1 2 3 4 5 10
where there is equal spacing between each of the above values.
You would need to make a factor of your levels, say “fac”, and then plot. Later using axis() with labels=as.character(fac).
Thinking further about @Ben Bolker’s question, it should also be possible to define a an auxiliary x-value to determine the plotting “x=” and the
axis“at=” coordinate on the horizontal and then usingunique(as.character(.))applied to the “real x” as the “labels=” argument toaxisas shown above but not needing a factor construction. An even more complex scheme is possible with this approach where continuous values across specific ranges of the auxiliary variable could be used for plotting but truncated values constructed for the labels at the boundaries of those ranges. I think further design justification and specification would be needed before building an implemented example.