MathGroup Archive 2008

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

Search the Archive

Re: A set of several questions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg90141] Re: A set of several questions
  • From: "M.Roellig" <markus.roellig at googlemail.com>
  • Date: Mon, 30 Jun 2008 04:54:39 -0400 (EDT)
  • References: <g451va$pq7$1@smc.vnet.net>

> 2. When I use the ContourPlot, I am not able add Text outside of the
> plot area by doing Show[plot, text]. The text simply doesn't show up.
>
Hi,

Show[plot,text] requires text to be a Graphics object. For example:

graph2 = ContourPlot[Sin[x]/Cos[y], {x, -1, 5}, {y, -3, 2},
   Frame -> True, Axes -> False];
txt = Graphics[Text["Example text", Scaled[{0.5, 0.5}]]]
Show[graph2, txt]

Here Show overlays both graphics, taking the PlotRange informatzion
from the
first one in the list. I used Scaled coordinates to place the text
relative to the Plot
Window.
If you want to place the text next to the Plot you have to use
Grid,GraphicsGrid or
GraphicsRow:

GraphicsRow[{graph2, txt}]

Check the Inset Documentation for a nice example how to use Inset and
Grid
to create a custom Plot legend.

Hope that helped

Markus


  • Prev by Date: Re: How to stop execution within a cell?
  • Previous by thread: Re: A set of several questions
  • Next by thread: Re: documentation specification for Documentation Center-iteration