Mathematica 9 is now available
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

Re: convert table into graphics object

  • To: mathgroup at smc.vnet.net
  • Subject: [mg56414] Re: [mg56397] convert table into graphics object
  • From: "David Park" <djmp at earthlink.net>
  • Date: Sun, 24 Apr 2005 03:29:05 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Juergen,

This is an interesting question.  You could use...

mygraphic = Show[Graphics[Text[myGraph, {0, 0}]]]

and then export mygraphic. However the matrix fills only the center of the
graphic and there is much wasted space. The obvious methods of trying to
change this, using PlotRange or PlotRegion do not work. However changing the
FontSize as in the following statement gives a graphic where the matrix
fills the space.

mygraphic =
  Show[Graphics[Text[StyleForm[myGraph, FontSize -> 50], {0, 0}]],
    ImageSize -> {300, 172}]

Otherwise, you could use more primitive routines to format your array
graphically. Line to draw the frame and four Text statements to fill in the
numbers. Something like this...

mytable = {{1, 2}, {2, 3}};

mygraphic =
 Show[Graphics[
    {AbsoluteThickness[2],
     Line[{{0, 0}, {1, 0}, {1, 1}, {0, 1}, {0, 0}}],
     Table[Text[StyleForm[mytable[[i,j]], FontSize -> 40],
       {i/2 - 0.25, j/2 - 0.25}], {i, 1, 2}, {j, 1, 2}]}],
   AspectRatio -> Automatic];

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/



From: juejung [mailto:juejung at indiana.edu]
To: mathgroup at smc.vnet.net


how can i convert the following expression into a graphics object, so that
i can export it as an eps?
is there something like a ConvertTo eps command. i know that in the menue,
if one goes to cell and then ConvertTo postscript it is possible to
convert the thing into a graph. but i have a lot of graphs and would
rather not do this by hand.

here's a sample expression:

myGraph = DisplayForm[FrameBox[TableForm[{{1, 2}, {2, 3}}]]]
Export["c:\Table11.eps", myGraph]

this won't work since myGraph is not a graphics object yet. any idea?

thanks.

juergen





  • Prev by Date: Re: to those interested in * finding * Mathematica help
  • Next by Date: Re: simplifying ulam spiral code
  • Previous by thread: Re: convert table into graphics object
  • Next by thread: xhtml + mathml + NotebookWrite