rmarkdown chart loses gridlines

I have several charts in rmd using ggplot and they show over 60 months of data. the charts have secondary axes and 4 series. I use vertical gridlines for each month.

My problem is that for some charts all the gridlines appear but for others only about 20 of them appear at random.

I have tried restart R and restarting the PC but the problem continues. Right now the first chart appears perfectly while the second which is a simpler version otherr first with 3 rather than 4 series has lost over 40 vertical gridlines.

At times the charts have all worked OK and so I wonder if there is some memory issue?

Any change you could ask this with a minimal REPRoducible EXample (reprex) that reproduces your issue?

Hi, since the issue is sporadic its hard to replicate. This seems to be talking about similar issue:

The solution there is to type Dev.off() at the console

Unfortunately I get an error I dont underrstand when I try this:

Error in dev.off() : cannot shut down device 1 (the null device)

Can you advise on that please?

Just realized its my bad. I'm missing dates!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.