MathGroup Archive 2009

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

Search the Archive

Re: Adding text to RegionPlot

  • To: mathgroup at smc.vnet.net
  • Subject: [mg98581] Re: Adding text to RegionPlot
  • From: Bill Rowe <readnews at sbcglobal.net>
  • Date: Mon, 13 Apr 2009 03:34:49 -0400 (EDT)

On 4/12/09 at 3:46 AM, jim.rockford1 at gmail.com (Jim Rockford) wrote:

>I would like to add text at specific (x,y) locations for a 2D
>graphic generated by RegionPlot (meaning, I'd rather not use the
>graphic tool and add text by hand).  Is there a way to do this?  I
>get mathematica complaints that RegionPlot is not a "type of
>graphics."

>For example, this code fails:

>RegionPlot[y <= (1/x^2) && y >= 0, {x, 1, 3}, {y, 0, 1}, PlotRange
>-> {{0, 3}, {0, 1}},Graphics[Text["mytext", {1.5, 1}]]

>Apparently I'm using Graphics[Text[]]  incorrectly.  How can I get
>such a simple function of putting text at a specific location to
>work in RegionPlot?

This does what you want

RegionPlot[y <= (1/x^2) && y >= 0, {x, 1, 3}, {y, 0, 1},
  PlotRange -> {{0, 3}, {0, 1}}, Epilog -> {Text["mytext", {1.5, 1}]}]

However, you have chosen the coordinates for the text to be on
the edge of the plot which causes the text to be partially
obscured. A better choice might be

RegionPlot[y <= (1/x^2) && y >= 0, {x, 1, 3}, {y, 0, 1},
  PlotRange -> {{0, 3}, {0, 1}},
  Epilog -> {Text["mytext", Scaled at {.5, .95}]}]



  • Prev by Date: Image Analysis: identifying objects with Mathematica 7.0
  • Next by Date: Dynamic popupmenu AND dynamic variables
  • Previous by thread: Re: Adding text to RegionPlot
  • Next by thread: Re: Adding text to RegionPlot