Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I created a plot with a horizontal BarLegend for TemperatureColors (see1).

Code:

PlotLegends -> 
     Placed[BarLegend[{"TemperatureMap", {15, 30}},Ticks -> Table[i, {i, 15, 31, 1}], LegendMarkerSize -> 300, 
       LegendLabel -> "T(\[Degree]C)", 
       LabelStyle -> {Bold, Black, 11}], {Bottom, Center}] 

Now I just want to have the BarLegend having the temperatures on it decreasing from left to right, means values and colors reversed with high temperatures on the left.

enter image description here

share|improve this question

1 Answer 1

up vote 6 down vote accepted
Plot[Sin[x], {x, 0, 1}, 
 PlotLegends -> 
  Placed[BarLegend[{ColorData["TemperatureMap"][1 - #] &, {15, 30}}, 
    LegendMarkerSize -> 300, LegendLabel -> "T(\[Degree]C)", 
    Ticks -> Table[{i, 45 - i}, {i, 15, 31}], 
    LabelStyle -> {Bold, Black, 11}], {Top, Center}]]

Mathematica graphics

share|improve this answer
    
You do realize that's not supposed to work, right? –  rcollyer Nov 5 '13 at 14:55
1  
@rcollyer Let's write a complain to WRI! :D –  belisarius Nov 5 '13 at 14:57
1  
You can also use ColorData[{"TemperatureMap","Reverse"}] –  Simon Woods Nov 5 '13 at 16:54
    
@SimonWoods Thanks! Never used it –  belisarius Nov 5 '13 at 16:59
    
Thanks to all of you! –  Shukoff Nov 5 '13 at 17:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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