How can I add a BarLegend
to the following plot?
b[x_] := x;
p1 =
Show[
Graphics[
Table[{Hue[i/20], Circle[{0, 0}, b[i]]}, {i, 1, 6, 0.1}],
ImageSize -> 350
], Frame -> True
]
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.
Sign up to join this communityClearAll[b]
b[x_] := x
Legended[
Graphics[
Table[{Hue[i/20], Circle[{0, 0}, b[i]]}, {i, 1, 6, 0.1}],
ImageSize -> 350, Frame -> True
],
BarLegend[{Hue[#/20] &, {1, 6}}]
]
Legended[]
? $\endgroup$Legended[]
needs a second argument that is something likeBarLegend[{Hue[#/20] &, {1, 6}}]
, depending on what you are trying to do (which you have not mentioned so far in your question, but should have been there). $\endgroup$