2
$\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$

1 Answer 1

4
$\begingroup$
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[{Table[Hue[c[7 - i]/(9*c[6])], {i, 6}], {c[6], c[1]}}, 
  LegendLabel -> "c(x)"]]   

enter image description here

$\endgroup$
2
  • $\begingroup$ Thanks for the answer. $\endgroup$
    – AAA
    Commented Jun 23, 2022 at 8:33
  • $\begingroup$ you are welcome! $\endgroup$
    – MMA13
    Commented Jun 23, 2022 at 8:38

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.