MathGroup Archive 2010

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

Search the Archive

Re: how to scale text to a bounding rectangle?


On 6/17/2010 2:03 AM, Michael wrote:
> The problem with both of these solutions is that I need the bounding
> rectangle to be in a Graphics[] expression because I'm creating several
> of these text filled boxes at arbitrary offsets.  I'm trying to create
> something similar to Graph[] (hopefully using it's embedding functions)
> but instead of vertexes I want to create collections of boxes containing
> text.  However Mathematica seems to render text independently of the
> coordinate range of the graphic.  For example, these two expressions
> produce identical output:

Have you looked at using GraphPlot with a VertexRenderingFunction?

For example:

GraphPlot[{"Hello" -> "World", "World" -> "Planet",
   "World" -> "Earth", "Hello" -> "Earth"},
  VertexRenderingFunction -> ({White, EdgeForm[{Black, Thick}],
      Disk[#, {.2, .1}], Black, Text[#2, #1]} &)]

--
Helen Read
University of Vermont


  • Prev by Date: Re: Ballistic launch trajectory code
  • Next by Date: whats wrong with this code ?!
  • Previous by thread: Re: how to scale text to a bounding rectangle?
  • Next by thread: Re: how to scale text to a bounding rectangle?