I have a question regarding a weird result for a line plot that uses facets.
I have water data masurements for different depth (=pressures). The data comes as a table as such:
Pressure Temperature pH
0 30 8.1
1 28 8.0
I “melt” this data to yield:
Pressure variable value
0 Temperature 30
1 Temperature 30
0 pH 8.1
1 pH 8.0
and so on. I now plot this:
ggplot(data.m.df, aes(x=value, y=Pressure)) +
facet_grid(.~variable, scale = "free") +
scale_y_reverse() +
geom_line() +
opts(axis.title.x=theme_blank())
It kinda works, except there are parts of the line plot that get filled with solid color. I have no idea why, especially because it works just fine if I exchange x for y and use “variable ~ .” as the facet_grid formula.

Note the difference between
geom_lineandgeom_pathapplied to the same data.Note the order in the
dfdata frame.geom_pathplots in order of the observations.geom_lineplots in order of x values.The effect is more marked when the x values are closer together.