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 graphing the 4 PDFs for a distribution for 4 different parameters in the same graph. I want the values of the parameters to be shown in corner of the graph. How do I do this?

share|improve this question
    
You can use Text[], among other things. However, it would be nice if you could show a picture of what you're expecting to see from us... –  J. M. May 4 '12 at 3:25
    
Something like this: upload.wikimedia.org/wikipedia/commons/thumb/e/ec/… –  Chris May 4 '12 at 3:32
    
Oh, you want a legend. That's slightly tricky business, and it has been discussed a number of times before here. Have a look at these. –  J. M. May 4 '12 at 3:49
    
Although I answered the question, I realize this is a duplicate of Creating legends for plots with multiple lines? - so it's justified to close this, I think. –  Jens May 4 '12 at 4:20
add comment

1 Answer 1

up vote 5 down vote accepted

The following is what you get using the code posted in my answer linked here:

All you have to do is make the plot, and call the function autoLegend I defined in the link:

styles = {Black, Directive[Dashed, Black], 
  Directive[DotDashed, Black], Directive[Dotted, Black]}
parameters = {1/2, 1/3, 1/5, 1/1000};
p = Plot[Evaluate[
    PDF[ExponentialDistribution[#]][x] & /@ parameters], {x, 0, 50}, 
   AxesOrigin -> {0, 0}, PlotStyle -> styles];
autoLegend[p, parameters]

legend

share|improve this answer
    
So cool, thanks alot! :) –  Chris May 4 '12 at 5:13
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.