Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

CellPrint with text, table and graphics

  • To: mathgroup at smc.vnet.net
  • Subject: [mg57610] CellPrint with text, table and graphics
  • From: "Hugh Goyder" <h.g.d.goyder at cranfield.ac.uk>
  • Date: Thu, 2 Jun 2005 05:16:48 -0400 (EDT)
  • Organization: University of Warwick, UK
  • Sender: owner-wri-mathgroup at wolfram.com

I am trying to work out how to mix text, a table and graphics all in one
cell. Developing a previous post (which I can't now find) I have got as far
as the code below.

1. Can my approach be improved on and made simpler?

2. Can the data in the table be aligned on the first digit so that the
negative sign projects to the left? I note that sign counts as one digit it
would be better if it didn't.

3. Can the heading for the column in the table, bk,  be centered over the
column? (The heading should be in Traditional form and be b subscript k but
this caused a flood of box forms to appear when I cut and pasted the email)



Thanks

Hugh Goyder

(* generate raw text, data and graphics *)
tx = "Some text";
bb = {-19214.88484, 230.1609318, -1.028803876, 0.002414336487,
-2.902395566 10^(-6), 1.430493449 10^(-9)};
tt = Transpose[{Table[n - 1, {n, Length[bb]}], bb}];
gg = Plot[x + 2Sin[x], {x, 0, 2Pi}, Frame -> True,
FrameLabel -> {ToString[Unevaluated[x "-axis"], TraditionalForm],
ToString[Unevaluated[x + y Sin[x]], TraditionalForm]},
TextStyle -> {FontFamily -> "Times", FontSize -> 16},
ImageSize -> 5 72];


(* format text, data and graphics *)
tx1 = StyleForm[tx,
FontFamily -> "Times", FontSize -> 18, FontSlant -> "Italic"]
tt1 = TableForm[tt, TableHeadings -> {None,
{ToString[Unevaluated[k], TraditionalForm],
ToString[Unevaluated[bk], TraditionalForm]}},
TableAlignments -> {Left}]
gg1 = Cell[GraphicsData["PostScript", DisplayString[gg]]];


(* print a cell with mixed text, data and graphics *)
CellPrint[
Cell[ BoxData[ GridBox[{{gg1, GridBox[{{ToBoxes[tx1]}, {ToBoxes[tt1]}},
RowsEqual -> False, RowLines -> True, RowSpacings -> 5]}},
RowAlignments -> Center, ColumnLines -> True, GridFrame -> True] ],
"Text"]]




  • Prev by Date: Re: Re: pure functions vs. functions
  • Next by Date: Re: How To Override FrontEnd/init.m Settings?
  • Previous by thread: Re: JLink / java.io.ObjectInputStream.redObject[] - ClassNotFoundException
  • Next by thread: Re: CellPrint with text, table and graphics