Hidden lines appearing in graph when printing PDF version



Hello everyone,

I'm writing to ask for an opinion about a particularly strange issue I'm facing in one of my plot exports:

i have a rather big dataset that I'm plotting. I trace the statistical median and confidence intervals of my quantities and then facet the data for each group. So far so good. The data are plotted nicely and all seems to be in order

I export the .wmf file for the graph (as it's the only vectorial format that can be imported in MS Word). The problem is that when I save my word file ( MS Word 2013) to a PDF format using the MS word pdf saving function, my converted file has problems for that graph.

Specifically close to 0 ( all my x , y values are positive ) there are weird lines appearing towards the left end of the data:

I'm sorry for giving you a vague description of the problem but in this case I cannot create a reprex a simplified example might not translate the problem. I'm not sure if it comes from my data or from something deep in the ggplot code. And I'm not at liberty to share so I need to redact :slight_smile:

the x and y axis are in log10 scale. logticks_annotation does not impact the appearance of the glitch or not...

Any ideas where I would have to look at? At worst I can print a tiff image or sth like that but its quality is not remotely comparable.

Again, aplogies for the vagueness of the problem description but my hands are tied :slight_smile:


I'm struggling to find examples of this problem elsewhere (r-help or stack overflow) with possible solutions. If you could produce a minimal example and you're convinced it's a ggplot2 issue, it would be a good issue to report (https://github.com/tidyverse/ggplot2/issues)

Obviously you have other image file-format options. Though, I personally always struggle with pdf and other vector graphics formats in word docs too.


Thanks for the effort. The thing is I'm using the identical code on other datasets as well but without the "linetypes" option in ggplot. and there's no issues there so it should be related to my data ...... on the other hand i cannot spot irregularities for my data in terms of extreme values etc etc....

The weird thing is the lines seem to be pointing towards a point outside of the frame of the facet (this plot was called by facet_warp as a last arguement)....

Thanks again ! I'll hink about how to generate some equivalent dataset.....


Side note: not sure if it's made it onto the standalone product yet, but Office 365 now has SVG support! It'll probably kill backwards compatibility, though, so you might wanna raise
rasterise the SVGs before sending the document to someone.


Posted a new issue on GitHub that includes a reproducible example of random data