When we plot many curves, due to repeated colors it becomes difficult to discern that which curve belongs to which equation.

For instance,

Plot[{n!, n^n, Exp[n], Log[n], n^100, 10^n}, {n, 0, 2},   PlotLegends
 -> "Expressions"]

If am wondering whether there is a way to differentiate the different curves by clicking on the equation and highlighting the respective curve?



2 Answers 2


Try this:

Plot[Tooltip[{n!, n^n, Exp[n], Log[n], n^100, 10^n}], {n, 0, 2}]

Now when you hover over the plot, the tooltip (the little popup window) tells which curve the mouse is pointing at.


You can also specify your own plot styles and for functions with large ranges consider LogPlot, e.g.

LogPlot[{n!, n^n, Exp[n], Log[n], n^100, 10^n}, {n, 0, 2}, 
 PlotStyle -> {{Red, Dashing[{0.03, 0.03}]}, Green, Blue, 
   Orange, {Purple, Dashing[{0.03, 0.03}]}, Black}, 
 PlotLegends -> "Expressions"]

enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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