Bar legend for a different function in mathematica

  • Context: Mathematica 
  • Thread starter Thread starter djymndl07
  • Start date Start date
  • Tags Tags
    Function
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 3K views
djymndl07
Messages
24
Reaction score
1
How Can I add bar Legend for g[t] in the following code in mathematica?
Thanks in advance?

f[t_] := t + 1
g[t_] := t^3 + 3*t + 12
ParametricPlot[{f[t]*Cos[\[Theta]], f[t]*Sin[\[Theta]]}, {t, 0, 1}, {\[Theta], 0, 2*Pi},
ColorFunction -> Function[{x, y, t}, ColorData["SolarColors"][Rescale[g[t], {g[0], g[1]}, {0, 1}]]]]
 
Physics news on Phys.org
Add
Code:
PlotLegends -> BarLegend[{"SolarColors", {0, 1}}]
to the ParametricPlot.