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.

How could I place a text box on the top of a bar chart where the top line would have a larger font size than the second line?

My Data:

totals4={{1093, "AUSTRALIA"}, {235, "BELGIUM"}, {474, "BERMUDA"}, {187, "BRAZIL"}, {103, "BAHAMAS"}};

This code will plot the PlotLabel-> as a long string. I would like to move " - excludes USA, as of: June 2012" to the second line with a smaller font and not bold. Ideally this text would be within a box, however I would just be happy to get the second line to display correctly.

BarChart[#, ChartStyle -> "DarkRainbow", PlotLabel -> 
Style["Entities with LEI Number - excludes USA, as of: June 2012", 
Bold, FontSize -> 12],  
ChartLabels -> (Placed[
Rotate[Style[#, Black], Pi/3] & /@ #2, {{.7, 0}, {1, 1}}])] & @@
Transpose[totals4]

enter image description here

I have tried this code but it is not displaying correctly:

BarChart[#, ChartStyle -> "DarkRainbow",
             PlotLabel -> Style[TraditionalForm[Grid[{
    {TextCell[    
         Row[{"Entities with LEI Number (excludes USA)",
        HoldForm[Subscript[a, b]], " As of June 2012"}], 
      TextJustification -> 1], SpanFromLeft},
    }, Frame -> All]
  ], FontFamily ._ "Times"],  
ChartLabels -> (Placed[
  Rotate[Style[#, Black], Pi/3] & /@ #2, {{.7, 0}, {1, 1}}])] & @@
 Transpose[totals4]

Any help would be appreciated.

share|improve this question
add comment

2 Answers

up vote 4 down vote accepted

You could try this:

BarChart[#, 
ChartStyle -> "DarkRainbow", 
PlotLabel -> Framed[Text[
Grid[{
{Style["Entities with LEI Number", Blue, FontSize -> 18]}, 
{Style["excludes USA, as of: June 2012", Red, FontSize -> 12]}}]]],
ChartLabels -> (Placed[Rotate[Style[#, Black], Pi/3] & /@ #2, {{.7, 0}, {1, 1}}])] & @@
Transpose[totals4]

Result:

enter image description here

share|improve this answer
add comment
PlotLabel -> Framed[Column[{
    Style["Entities with LEI Number", Bold, FontSize -> 12], 
    Style["excludes USA, as of: June 2012", FontSize -> 10]}]],

gives

enter image description here

This uses the Column function to allow two as many Style commands as you might wish, and Framed makes the frame around the two elements of the columns. You can provide any kind of styling you wish in each of the elements of the column.

share|improve this answer
    
Thanks, Is there a way to change the font and un-bold the second line? –  sente Jun 11 '13 at 12:28
add comment

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.