Skip to content
Prev 58486 / 398502 Next

Labelling contour lines

I am using contour to draw contour lines onto a photo (jpeg) of a leaf on 
a white background.

I have two problems:

1) The contour gets plotted at right angles to the jpeg image. I guess 
this is a problem of referencing the start and end points of the image 
matrix but I can't see how to over come this other than loading in a 
second image that has been rotated 90 degrees and plotting the contours on 
the non-rotated one (obviously a bad solution)

2) I want to be able to select a single contour after they have been 
drawn. I know there is contourLines but I can't see how to relate this to 
the contours plotted. In matlab there is a function to label contours so 
that they can be called by their contour label in order to get the 
coordinates of the contour. Can this be done in R.

Sorry if these are easy / stupid questions. I'm new to all this. I have 
searched previos posts but can't find the answers I need and I would 
rather be able to use R than matlab.

Thanks