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$
    – AKU
    2 days ago
  • $\begingroup$ you are welcome! $\endgroup$ 2 days ago

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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