Samples desappear in line plot pdf path

Anyone knows how matplotlib creates the path of the pdf from a plot?
I found a strange behavior because the nodes of the path doesn’t coincide with the original data samples.
Do it get rid of co-linear points (or approximately co-linear that wouldn’t affect plot visualization) for compaction purposes, for example?

I did three plots, one using line only (default), another using samples marks only, and the last one using line with samples marking. Whenever a line was plotted its path in the pdf didn’t had as many nodes as it had samples.