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.

My PlotLabel goes beyond the width of the ImageSize. The label is generated into a List form by my program. I hope to allow my PlotLabel to go to a second, third, fourth (...) line if it reaches beyond the boundaries. My problem in simplified, working code:

testList = {1.1`, 1.2100000000000002`, 1.4641000000000004`, 
   2.143588810000001`, 4.594972986357221`, 21.1137767453526`, 
   445.7915684525922`, 198730.12250342217`, 3.949366159022518`*^10, 
   1.5597493058032278`*^21, 2.432817896953651`*^42, 
   5.918602919737985`*^84, 3.5029860521531003`*^169, 
   1.22709112815791634686748164742131068419446205954341`15.\
653559774527023*^339, 
   1.50575263680386788043945221511499961813146`15.352529778863042*^\
678, 2.2672910032418008565810795918131168775255956636`15.\
051499783199061*^1356, 
   5.1406084933812118223464178513329285`14.75046978753508*^2712, 
   2.64258556822230525123173280428744040060801405497404`14.\
449439791871098*^5425, 
   6.98325848537680392124060228920952089211156`14.148409796207117*^\
10850, 4.8765899073587133585511396520327915438254972718`13.\
847379800543136*^21701};
Plot[x^2, {x, -3, 3}, 
 PlotLabel -> StringForm["The orbit of x=1.1 is\n``\n", testList ], 
 ImageSize -> {600, 600}]

enter image description here

share|improve this question
add comment

3 Answers

up vote 10 down vote accepted

If you create a TextCell then it will wrap the list nicely. PageWidth controls the width of the text cell.

Plot[x^2, {x, -3, 3}, PlotLabel -> 
    StringForm["The orbit of x=1.1 is\n``\n", TextCell[testList, PageWidth -> 600]],  
    ImageSize -> {600, 600}]

enter image description here

You can change the appearance of the TextCell (font, fontsize, color, etc) using various options as shown in the help files for TextCell and Cell.

share|improve this answer
    
The copied code sends my list to two lines instead of one, but still goes beyond the viewable area. –  twhoward99 Jun 5 '13 at 16:25
    
Above is the picture I got. You know.. if you play with the window width it changes the layout of the textcell. Maybe my default window width is different from yours... –  bill s Jun 5 '13 at 16:27
    
Could I change the width of the TextCell? Its for a .cdf file and the output size needs to be constrained somewhat. –  twhoward99 Jun 5 '13 at 16:32
    
See the change -- this one gives me the same picture, but now the width of the textcell is specified (and it doesn't change when you resize the window). –  bill s Jun 5 '13 at 16:35
    
Works like a charm! Thank-you very much! –  twhoward99 Jun 5 '13 at 16:40
add comment

Slightly better than my last attempt:

Row[{
  Plot[x^2, {x, -3, 3}, ImageSize -> {400, 400}],
  Panel[testList, "The orbit of x=1.1 is", Top, 
   ImageSize -> {400, 120}]
  }]

panel

share|improve this answer
    
Nice solution!! –  twhoward99 Jun 5 '13 at 16:41
add comment

A nine-character solution: add ~Pane~600 to the end of the PlotLabel.

share|improve this answer
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.