0
$\begingroup$

I am using the following code where color and color barlegend show the radius of the concentric circles:

ClearAll[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}}]
]

Can the code be adapted to show the area of the circles instead?

$\endgroup$

1 Answer 1

2
$\begingroup$
ClearAll[b]
b[x_] = x;
Legended[Graphics[
  Table[{Hue[π*i^2/(π*6^2)], Circle[{0, 0}, b[i]]}, {i, 1, 6, 
    0.1}], ImageSize -> 350, Frame -> True], 
 BarLegend[{Hue[#/(π*6^2)] &, π {1, 6}^2}]]

enter image description here

$\endgroup$
1
  • $\begingroup$ I am using it like this . Now how to set barlegend numbers according to the c[x] value? c[x_] := (1 - 0.01/x^2)/( 4 [Pi] Sqrt[(1 - 0.0005/x) (1 - x/20)] x); b[x_] = x; Legended[Graphics[ Table[{Hue[c[i]/(9*c[6])], Circle[{0, 0}, b[i]]}, {i, 1, 6, 0.1}], ImageSize -> 350, Frame -> True], BarLegend[{Hue[c[#]/(9*c[6])] &, {1, 6}}]] $\endgroup$
    – AAA
    Commented Jun 23, 2022 at 5:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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