Having to plot altimeter profiles computed from .gpx tracks of hiking/biking routes, I've normal XY graphs, where X is the progressive distance covered, and Y is the altitude:
I know also the surface of each segment of a track (asphalt, ground, cobblestone, ...) , so my data.table TRACKS is in the form:
PROGDIST ALTITUDE SURFACE
50 110 asphalt
100 123 asphalt
150 146 asphalt
200 124 asphalt
250 141 asphalt
300 141 asphalt
350 148 ground
400 118 ground
450 120 ground
… … …
I'd like to enrich the graph with this information, obtaining something like this:
I tried to use geom=c("area", "line") with qplot, and geom="ribbon" from ggplot2, but my actual knowledge of these packages is not enough, so any help will be welcome!