1
$\begingroup$

I would like to get label in BarLegend[{"TemperatureMap", {-Pi/2, Pi/2}}] to be from -90 ° to 90 °. Kindly see figure below.

enter image description here

$\endgroup$
2
$\begingroup$
ticks = Transpose@{Range[-90, 90, 45], Range[-90 Degree, 90 Degree, 45 Degree]};

legend = BarLegend[{ColorData[{"TemperatureMap", {-90, 90}}], {-90, 90}},
          Charting`Ticks -> ticks]

enter image description here

$\endgroup$
  • $\begingroup$ I am using Mathematica 10, but this is not working. It gives the right label but without color inside the barlegend $\endgroup$ – HD2006 Mar 23 '17 at 23:24
  • $\begingroup$ I am using Mathematica 10, but this is not working. It gives the right label but without color inside the barlegend. @corey979 $\endgroup$ – HD2006 Mar 25 '17 at 0:10
  • $\begingroup$ @Abdullah I'm using v10.4.1 and apparently it works. $\endgroup$ – corey979 Mar 25 '17 at 0:42
1
$\begingroup$
BarLegend[{"TemperatureMap", {-90 Degree, 90 Degree}}, 
 "Ticks" -> Range[-80 Degree, 80 Degree, 20 Degree]]

Mathematica graphics

$\endgroup$

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.