0

Since I have updated R to version 3.5.2, my pirateplots (yarrr library) show more y axis ticks than before. Before they only showed ticks at full number values (1, 2, 3, etc., 1), but now they also show ticks at .5 values (1, 1.5, 2, 2.5, 3, etc., 2). This is despite the fact that the data and scripts are exactly the same as before.

Do you know how I can remove the .5 value ticks and make the plots look like they looked before?

Lucius
  • 3
  • 3
  • Have you looked at [this](https://stackoverflow.com/questions/3785089/change-the-spacing-of-tick-marks-on-the-axis-of-a-plot) question? – Edgar H Feb 08 '19 at 13:13

1 Answers1

0

I think the yaxt.y argument is what you're looking for as it allows you to override the default y axis construction.

Here's a plot using default arguments

pirateplot(weight ~ Diet, data = ChickWeight)

Original plot

Now with the yaxt.y argument

pirateplot(weight ~ Diet, data = ChickWeight, yaxt.y = seq(0, 400, 25))

Second version

You can also specify the grid line widths with gl.lwd:

pirateplot(weight ~ Diet, data = ChickWeight, yaxt.y = seq(0, 400, 25), gl.lwd = c(.5, 1.5), gl.col = "black")

Third version

Hope this helps!

  • Unfortunately, the yaxt.y parameter doesn't seem to work for me. When I run your code (second version), I get the following error message: `Error in pirateplot(weight ~ Diet, data = ChickWeight, yaxt.y = seq(0, : unused argument (yaxt.y = seq(0, 400, 25))` I use yarrr version 0.1.6. Any idea what the issue could be? Thanks! – Lucius Feb 25 '19 at 14:40
  • Update: I just uninstalled and reinstalled Yarrr and now it works. I now use the latest developer version from GitHub. Perhaps that made the difference. Thanks for your help! – Lucius Feb 26 '19 at 11:14