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
    Jun 23, 2022 at 8:33
  • $\begingroup$ you are welcome! $\endgroup$
    – MMA13
    Jun 23, 2022 at 8:38

Your Answer

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

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