I want to draw a bisection Y-axis plot which scaled from 0 to 100. At first section (1 to 30) it would be ranged by 2 (2,4,6,...,30)and after that it would be ranged by 10 (30,40,50,...,100). how can I draw this plot?
If the axis should show one variable, I would NOT suggest to cut the axis. Instead, better use a logarithmic scale if your aim is to show small and large values on the same axis.
However, if you still want to do this, you need to invest some work to convert between coordinate systems (scales). This is all simple arthmetic. Here is an example script that will produce a scatterplot with a cut y-axis:
# x: x-values
# y: y-values
# s1, s2: scales: vectors with tickmark positions. s1 is the "lower" scale, s2 is the "upper" scale. # ratio: ratio of the length of s2 relative to s1. A ratio of 1 means that both scales will be represented with the same length
# cutw: witdth of the cutting region between the scales relative to the total height of the plotting region
# bty: box-type, by default set to "n" (no surrounding box)
# ...: other arguments passed to plot() and to points()
cutplot 0 & cutw < 0.5)
stopifnot (length(s1)>1 & length(s2)>1)
stopifnot (identical(c(s1,s2), sort(c(s1,s2))))
# get helpers for conversion from scales s1 and s2 to y-scale