I need to plot a simple graph in R (preferably using plot) with different distance between some x axis values. I have been trying to accomplish this using the axis function with "at" and "label" parameters. However, I think that the final result is not what should be.
As example, suppose x = seq(1,10,by=1)
and y = 2*x
.
Now, let's plot doing:
plot(x = x, y = y, type='l', xaxt='n');
axis(1, c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
at = c(1, 1.1, 1.2, 1.3,1.4,1.5,1.6,1.7,1.8,1.9));
I would expect a thin and tall graph but the resulting plot is:
Why the graph did not respect the new scale of the x axis and replaced the position 2 by 1.1, 3 by 1.2 and so on? How could I do this?
The real graph is something like : real graph
I need to highlight the slope between (x1,y1) to (x2,y2) and between (x3,y3) to (x5,y5). There are 100 values in axis X and If I leave the same space between them in the graph these slopes I mentioned will be imperceptible
I hope I have been clear in my question.