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.

The default font-size of Legend text generated using ShowLegend[] is too small. How does one increase this? The code I am working with is:

Needs["PlotLegends`"]
LstTest = Flatten[Table[{i, j, (i + j)/200}, {i, 1, 100}, {j, 1, 100}], 1];
plTest = ListContourPlot[LstTest, Contours -> 9, ColorFunction -> "Rainbow"];
LMax = Max[LstTest[[All, 3]]]; LMin = Min[LstTest[[All, 3]]];

ShowLegend[plTest, 
           {ColorData["Rainbow"][1 - #1] &, 
            10, 
            ToString[Round[LMax, 0.01]], 
            ToString[Round[LMin, 0.01]], 
            LegendPosition -> {0.6, 0}
           }
          ]

The 0.01 and 1.0 appear too small, and I would like to increase the font-size of these. Thanks for any help!

share|improve this question
    
@Nasser try Needs["PlotLegends"], that should at least give you the legend. –  Jonie Aug 2 '13 at 6:36
    
@Nasser I totally agree with that. I just hope the OP will keep that in mind for next time. –  Jonie Aug 2 '13 at 6:44
    
Sorry! I thought the data can be generated quite easily. I have made it complete now. Also, I am using Mathematica 8.0. –  Shrihari Aug 2 '13 at 7:03

1 Answer 1

up vote 5 down vote accepted
Needs["PlotLegends`"];

Manipulate[

 ShowLegend[
  plTest,
  {ColorData["Rainbow"][1 - #1] &,
   10,
   ToString[Round[LMax, 0.01]],
   ToString[Round[LMin, 0.01]],
   LegendPosition -> {0.6, 0},
   BaseStyle -> {FontSize -> n}
   }
  ],

 {{n, 12, "how big?"}, 4, 16, 1,Appearance -> "Labeled"},
 ContinuousAction -> False,
 Initialization :>
  (
   LstTest = Table[RandomReal[{0, 1}], {10}, {10}, {10}];
   plTest = ListContourPlot[LstTest, Contours -> 9,ColorFunction -> "Rainbow"];
   LMax = 1.0; LMin = 0.79;
   )
 ]

Mathematica graphics

share|improve this answer
1  
Great! Thanks @Nasser. That works! From next time, I will post complete code. Sorry about this. –  Shrihari Aug 2 '13 at 7:17

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.