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 am finding a local maximum of a curve and I want to make the plot easier to read. I added a point to where the maximum is but I would also like to:

1) add a tick with text below it where the x value of the maximum is (saying "Xmax" or " X* ")

2) a dotted line from the point down to the x-axis.

Here is a simpler version of the plot I'm making:

maxi = FindMaximum[Cos[x], {x, 4, 8}];
coordin = {x /. maxi[[2]], First[maxi]};
Plot[Cos[x], {x, 0, 4 \[Pi]}, Epilog -> {PointSize[Large], Point[coordin]}]

I have pictures to better explain this but I'm not allowed to post images.

share|improve this question
1  
"I have pictures to better explain this but I'm not allowed to post images." - maybe post a link to your images, and I (or somebody else) will put them in for you. –  J. M. Apr 23 '13 at 15:04
add comment

1 Answer

Is this what you want?

maxi = FindMaximum[Cos[x], {x, 4, 8}];
coordin = {x /. maxi[[2]], First[maxi]};
Plot[Cos[x], {x, 0, 4 \[Pi]}, 
 Epilog -> {PointSize[Large], Point[coordin], Dashed, 
   Line[{coordin, {coordin[[1]], 0}}], Text["X", coordin + {0.5, 0}]}]

enter image description here

share|improve this answer
    
:) close! how do you put the "X" below the x axis? –  LiaChica Apr 23 '13 at 15:26
    
How about change Text["X", coordin + {0.5, 0}] to Text["X", {coordin[[1]], -0.1}]? –  user0501 Apr 23 '13 at 15:29
    
Got it! Thank you! :-) –  LiaChica Apr 24 '13 at 10:31
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.