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.

Sometimes, I want to provide a key or legend for my Plot or ListPlot without using the PlotLegends package. Sometimes, I just want to use the option PlotLabel inside my Plot or ListPlot:

Plot[{x^2, x^3}, {x,0,10}, PlotStyle->{Red, Blue}, 
    PlotLabel->"Red curve: x^2\nBlue curve: x^3"]

Is there any way to actually make the string "Red curve: x^2" red and the string "Blue curve: x^3" blue, within PlotLabel?

share|improve this question
add comment

1 Answer

up vote 7 down vote accepted

Yeah, use Style and Column to format the PlotLabel:

PlotLabel -> Column[{Style["Red curve: x^2", Red], Style["Blue curve: x^3", Blue]}]]

Example: enter image description here

share|improve this answer
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.