Reputation: 1563
I try to do a plot with R with the command below, but I got the line between 0 and 20. How can I precise that the first value 32.2 correspond to 10 (abcissa), the second value 32.2 correspond to 20 (abcissa)?
Deuxgrammes <- c(32.2, 32.2, 32.2, 32.2, 32.2, 32.2, 32.2, 32.2, 32.2)
plot(Deuxgrammes, type="o", col="blue", xlim =c(0,100), ylim=c(26,33))
Upvotes: 1
Views: 49
Reputation: 820
I think, at least one simple way, is you can also define x values as
x = seq( from = 10, by = 10, length.out = length( Deuxgrammes ) )
and then just plot them.
plot (x, Deuxgrammes, type="o", col="blue", xlim = c(0,100), ylim=c(26,33))
In addition to that, if the axes differ, you can change the labels.
Upvotes: 1