Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I have a contour plot that took a few hours to evaluate. Is there a way that I can show only the contour lines of a specific value without re-evaluating the contour plot?

share|improve this question
    
Did you want the shading? The question's been changed to assume that you don't... –  cormullion Jul 23 '13 at 17:20
add comment

1 Answer

Try this:

p = ContourPlot[Im[(x + I y)^(1/2)], {x, -1, 1}, {y, -1, 1}, 
   Contours -> 21, ColorFunction -> Hue];

p /. {___, EdgeForm[___], ___} :> {}

plot

Edit

To isolate a contour line of a particular value, you could use Tooltip information in an automated way, but let's assume that you don't have those enabled.

Then how do you extract the desired contour? Here is a manual way that always works as long as you can visually pick out the contour you're interested in:

Graphics[Normal[p][[1]]]

editor

What I've done above is to display the graphic for the contour plot in a very bare-bones way. Then I double-clicked on the graphic to activate the Drawing Tools. They allow me to select a particular contour by double-clicking again. If you get the contour to be highlighted as above, you should be good to go for the next step:

Copy the highlighted contour the usual way (using Edit menu or shortcut), then type this:

Show[   , Frame -> True, PlotRange -> {{-1, 1}, {-1, 1}}]

Here, paste the copied graphic into the empty space in the first argument of Show.

Now you'll have the contour isolated, in exactly the right position relative to the frame that I re-created above.

contour

For this to work, it's important to convert the contour plot using Normal as I did above, so all objects have the information about their absolute coordinate placement.

share|improve this answer
    
There is just one thing to do... select the lines corresponding to one value only. But that should be possible by the tooltips. Or maybe even a better way? –  sebhofer Jul 23 '13 at 16:23
    
@sebhofer I forgot that part... Question for the OP: did your original plot contain Tooltps? That would allow you to identify the contour you want. –  Jens Jul 23 '13 at 16:26
1  
In that case I think one could use p/.Tooltip[_, Except[label]] :> Sequence[] to delete the unwanted lines... –  sebhofer Jul 23 '13 at 16:33
    
@sebhofer That definitely works, if he has tooltips. I decided to answer in a different way in my edit. –  Jens Jul 23 '13 at 16:50
    
Thanks so much for your help! –  user85503 Jul 25 '13 at 22:18
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.