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

1 Answer 1

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

This site is currently not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .