Re: Re: Table as Graphics Object?
- To: mathgroup at smc.vnet.net
- Subject: [mg35080] Re: [mg35068] Re: [mg35027] Table as Graphics Object?
- From: Dale Horton <daleh at wolfram.com>
- Date: Mon, 24 Jun 2002 03:21:09 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
There are much easier ways to create a bitmap from a Cell. You don't need to use menu commands. All you need are Import and Export. ls = Table[Random[Integer, {1, 6}], {5}, {5}]; myGraphic = ListPlot3D[ls, DisplayFunction -> Identity]; Create a Cell expression for the Table (like you'd see with Format>Show Expression), then round trip it through a bitmap format. For example, "GIF". myTable=ImportString[ ExportString[Cell[BoxData@ToBoxes@TableForm@ls, "Output"], "GIF"],"GIF"] Show[GraphicsArray[{myGraphic,myTable}]] Since myTable is a Raster graphic, it does not scale well. However, if you use a scalable format (such as EPS) then the text will not become distorted. Resizing will change the space in the table, but not the size of the elements. (Sorry, that's the way PostScript works.) To change the size of the elements, use a StyleBox to set the FontSize. myTable = ImportString[ ExportString[ Cell[BoxData@StyleBox[ToBoxes@TableForm@ls, FontSize -> 16], "Output"], "EPS"], "EPS"] -Dale At 10:56 PM 6/20/2002, Andrzej Kozlowski wrote: >Perhaps it may be useful to make a quick summary of the three approaches >I proposed in answer to this question. The first method creates a bitmap >representation of the table of numbers or symbols, and while it does >scale, it looses quality, as bitmaps do. The second approach produces a >graphic representation of a table that can be scaled to an arbitrary >size and whose font can be changed by setting $DefaultFont to any chosen >font or size. However this method is less flexible: for example I think >one can't create matrix brackets using it. Finally, the last approach >produces a fixed size, fixed font graphic representation of a table. > >Andrzej