I have a plot in R with both x
and y-axes
tick labels looking like this:
-1.5 -1.0 -0.5 0.0 0.5 1.0
How can I remove the -
1.5, -0.5, 0.5 tickmarks/labels
?How can I remove the decimal from the remaining labels? (i.e. -
1.0
to become-1
).
I have a plot in R with both x
and y-axes
tick labels looking like this:
-1.5 -1.0 -0.5 0.0 0.5 1.0
How can I remove the -1.5, -0.5, 0.5 tickmarks/labels
?
How can I remove the decimal from the remaining labels? (i.e. -1.0
to become -1
).
So, a plot like this is what I hear you describing:
plot(seq(-1.5, 1.1, 0.5),seq(-1.5, 1, 0.5))
Adding the xaxp and yaxp vectors will let you fine-tune the labeling:
plot(seq(-1.5, 1.1, 0.5),seq(-1.5, 1, 0.5), xaxp=c(-1,1,2), yaxp=c(-1,1,2))
The input to xaxp is "A vector of the form c(x1, x2, n) giving the coordinates of the extreme tick marks and the number of intervals between tick-marks when par("xlog") is false." See the help page for par{graphics} for more details