MathGroup Archive 2009

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

Search the Archive

Re: Plot3D, show and text

  • To: mathgroup at smc.vnet.net
  • Subject: [mg98343] Re: Plot3D, show and text
  • From: Albert Retey <awnl at gmx-topmail.de>
  • Date: Mon, 6 Apr 2009 05:04:07 -0400 (EDT)
  • References: <gra1ph$2i5$1@smc.vnet.net>

Marc ESCALIER wrote:
> Hello,
> 
> Is there an expert over there, who would able to add, using mathematica:
> a text "abc" at position "1,1,2" and
> a text "def" at position "2,2,4", by :
> 
> keeping same looking at the original plot (no changing of ratio x, y, z)
> keeping Show (because i need to put other stuff inside)
> 
> Show[Plot3D[-8*(x*x+y*y)+(x*x+y*y)*(x*x+y*y),{x,-3,3},{y,-3,3},BoxRatios-=
>> {3,4,2},Mesh->None,ClippingStyle->None,RegionFunction->Function[{x,y,z},=
> x^2+y^2<9 && x<2],Boxed->False,Axes->True,AxesOrigin->{0,0,-16.5}]

hm, actually I would think you need Show to do this, anyway:

Show[
 Plot3D[
  -8*(x*x + y*y) + (x*x + y*y)*(x*x + y*y), {x, -3, 3}, {y, -3, 3},
  BoxRatios -> {3, 4, 2}, Mesh -> None, ClippingStyle -> None,
  RegionFunction -> Function[{x, y, z}, x^2 + y^2 < 9 && x < 2],
  Boxed -> False, Axes -> True, AxesOrigin -> {0, 0, -16.5}
  ],
 Graphics3D[{Text["abc", {1, 1, 2}], Text["def", {2, 2, 4}]}]
 ]

note that the ordering of Plot3D and Graphics3D is relevant, using the
ordering as above will use the BoxRatios of Plot3D even when the
Text[]-Primitives don't fit into the resulting plot. In version 6 and 7
 Show will use the options of the first thing to show by default, this
has changed from version 5.x and was discussed more than once in this
group. Of course I can't tell whether it will change in future versions.
Using AbsoluteOptions you could enforce Show to use options of another
object in the arguments, but as long as you stay with version 6 and 7
putting the relevant object as the first argument should do the trick.

hth,

albert


  • Prev by Date: Re: release memory
  • Next by Date: RE: Plot3D, show and text
  • Previous by thread: Re: Plot3D, show and text
  • Next by thread: RE: Plot3D, show and text