Closed ksmetz closed 1 year ago
Hi Katie!!
Thank you so much for picking out this bug. You are correct and this wasn't the intended behavior. I went back and updated how we created the yaxis grobs before drawing them, which removes the re-drawing and hence extra page creation. This should be fixed in Release version 1.6.3 and devel version 1.7.4!
Nicole
Hey plotgardeners! 🌱
I noticed what appears to be a small bug in the
annoYaxis
function, that causes it to re-plot on a new page when writing to PDFs.The behavior appears to be similar to when you run
pagePlotRemove
orpageGuideHide
(or at least how they used to behave, I haven't tested them in a PDF recently), where it saves the current plots to one page and then makes a new page with the change on it. I think this may be specifically related to theaxisLine = FALSE
default setting, because on the pages it will first show the y-axis with the line, and on the second page the line will be removed - although I haven't poked around the code itself to be sure yet.This can currently be worked around by just drawing the axisLine with
axisLine = TRUE
. If you aren't doing a survey plot you can also manually trim the PDF to the final page after producing it. That said I wanted to post about it in case it wasn't the intended behavior, since it could be problematic if you really wanted to have a line-less y-axis in a survey plot I guess?Here's a sample PDF where you can see it in action. This is the general structure of my script:
And here is the output: Ghule2023-MicroC-HLB_observed-c12arches.pdf
You can see how the PDF has everything up to the first
annoYaxis
on page 1 (with a vertical y-axis line), then everything up to the secondannoYaxis
on page 2 (first axis lost its vertical line but second has one), then to the end on page 3 (neither axes have a vertical line).