Betina Brender
Betina Brender

Reputation: 1

How to specify the actual x axis values to plot as y axis ticks in R

How can I change the spacing of tick marks on the y axis, when I have lines with low and lines whit high values? I have tried to use this comand: axis(2, at = seq(1, 7, by = 0.5), las=2)

But it dosn't gives more than values from 2-7 with intervals 0.5. I think it is because the line I have used only has values from 2-7. I have no lines which has values in the whole interval. How do I make a plot with tick marks in the whole interval?

Upvotes: 0

Views: 104

Answers (1)

royr2
royr2

Reputation: 2289

You could use the ylim argument to specify the limits of the y-axis like such:

x = 1:100
y = seq(2, 7, length.out = 100)

plot(x, y, ylim = c(0,8))

Upvotes: 0

Related Questions