MathGroup Archive 1999

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

Search the Archive

Re: text erases parts of graphics

  • To: mathgroup at smc.vnet.net
  • Subject: [mg21241] Re: [mg21204] text erases parts of graphics
  • From: Hartmut Wolf <hwolf at debis.com>
  • Date: Mon, 20 Dec 1999 02:28:02 -0500 (EST)
  • Organization: debis Systemhaus
  • References: <199912170624.BAA02112@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Patrick Hansmeier schrieb:
> 
> I tried to get some explanations next to a graph, using
> Text[]. Platform is Mathematica 4.0, Sun Solaris 7.
> 
> However, the text box seems to extend past the characters, its
> background erasing parts of the plot. In the latter example, the graph
> is wiped out right of the text.
> 
> e1 = Graphics[Text["Pulse", {7, 0.1}]];
> e2 = Graphics[Plot[Sin [x], {x, 0, 9\[Pi]}]];
> Show[e2, e1]
> 
That's a behaviour which I do not observe (Mathematica 4.0 on PC, Windoes-NT).

> With Show[e1, e2] I get the uninterrupted graph, but no more axes
> (same would apply to gridlines, if drawn). Experiments with
> Background->Automatic or None provided no solution.
> 
That's right.


> The prob persists with the examples in the help browser as given in
> Math. Book's chap. 2.9.16, e.g.
> 
> Show[Graphics[{{GrayLevel[0.5],
>            Rectangle[{0, 0}, {1, 1}]},
>              Text["Some text", {0.5, 0.5}]}]]
> 
> gives the rectangle, the text with the notebook's background colour
> and a stripof that colour extending from the text to the right (more
> generally, to the direction given by the dir-parameters, if set).
> 

Dear Patrick,

the following should come out in an acceptable way

Plot[Sin[x], {x, 0, 9\[Pi]}, 
  Epilog -> 
    Text["Pulse", {7, 0.1}, 
      TextStyle -> {FontFamily -> "Helvetica", FontSlant -> "Italic", 
          FontSize -> 10}, Background -> GrayLevel[0.9]]]

If you use Prolog instead of Epilog, then the plot will be drawn obver
the text, and of course you need not give the option Background.

Perhaps you also want to experiment with

<< Graphics`Legend`

Plot[Sin[x], {x, 0, 9\[Pi]}, PlotLegend -> {"Pulse"}, LegendShadow ->
None, 
  LegendPosition -> {0.5, -0.5}]

Or, if you want to suppress the line in the legend

ShowLegend[e2, {{{Graphics[{}], 
        StyleForm["Pulse", FontFamily -> "Helvetica", FontSlant ->
"Italic", 
          FontSize -> 10, Background -> Hue[0.07, 0.3, 1.]]}}, 
    LegendShadow -> None, LegendPosition -> {-0.7, -0.1}}]

Hope this helps somewhat, you'll also find more explanation in Help. 

Kind regards, Hartmut


  • Prev by Date: Re: Ticker Tape/Theater Marquee Display?
  • Next by Date: Re: modified list interval calculation
  • Previous by thread: text erases parts of graphics
  • Next by thread: Re: text erases parts of graphics