yarrr
yarrr copied to clipboard
Set intervals on the y-axis
Is there a way to specify the intervals for the y-axis of a pirate plot? My data has values from 1 to 5, but the y-axis includes values for 1.5, 2.5 etc. Is there a way to get it to only show integers on the y-axis?
Hmmm, currently there is not. But you can turn off the axis yourself and add a custom axis later with axis
.
E.g.
# Create the plot and turn off the yaxis with yaxt = "n"
yarrr::pirateplot(weight ~ Diet, data = ChickWeight, yaxt = "n")
#Add a custom axis
axis(2, at = seq(from = 0, to = 1000, by = 100))