r - Change the spacing of tick marks on the axis of a plot? -


how can change spacing of tick marks on axis of plot?

what parameters should use base plot or rgl?

there @ least 2 ways achieving in base graph (my examples x-axis, work same y-axis):

  1. use par(xaxp = c(x1, x2, n)) or plot(..., xaxp = c(x1, x2, n)) define position (x1 & x2) of extreme tick marks , number of intervals between tick marks (n). accordingly, n+1 number of tick marks drawn. (this works if use no logarithmic scale, behavior logarithmic scales see ?par.)

  2. you can suppress drawing of axis altogether , add tick marks later axis().
    suppress drawing of axis use plot(... , xaxt = "n").
    call axis() side, at, , labels: axis(side = 1, @ = v1, labels = v2). side referring side of axis (1 = x-axis, 2 = y-axis), v1 being vector containing position of ticks (e.g., c(1, 3, 5) if axis ranges 0 6 , want 3 marks), , v2 vector containing labels specified tick marks (must of same length v1, e.g., c("group a", "group b", "group c")). see ?axis , my updated answer post on stats.stackexchange example of method.


Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -