Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Re: [mg5235] labelling contours
Replies: 0

 Daitaro Hagihara Posts: 43 Registered: 12/7/04
Re: [mg5235] labelling contours
Posted: Nov 18, 1996 2:05 AM

The following strip of Mma code, which I wrote eons ago, shows the use of =
LabeledListPlot to "simulate" labeling contours. May not be the best =
example, but it works (for me at least).

Regards,

profit =3D ( 1 - c ) p^p ( ( 1 - p ) / t )^( 1 - p ) ( 1 + t ) ;
<<Graphics`Graphics`
points =3D Table [
{ ( 1 - c ) ( -1 + p + p t ), ( 1 - c ) ( -1 + p + p t ) / t,
StringForm [ "``%", Round [ 100 p ] ] } /.
( FindRoot [ # =3D=3D 1, { t, 2 }, MaxIterations -> 100 ] & @
( profit /. c -> 10 / 100 ) ) /. c -> 10 / 100,
{ p, .5, .9, .05 } ] ;
g1 =3D LabeledListPlot [ points, DisplayFunction -> Identity ] ;
g2 =3D Table [ Graphics [ Line [ Table [ { x, y } /.
( FindRoot [ # =3D=3D 1, { y, .2 }, MaxIterations -> 100 ] & @
( ( 1 - c + x )^p ( 1 - c - y )^( 1 - p ) /. c -> 10 / 100 ) ),
{ x, .2, .8, .001 } ] ] ], { p, .4, .9, .05 } ] ;
Show [ Append [ g2, g1 ], DisplayFunction -> \$DisplayFunction,
PlotRange -> { { .2, .8 }, { .2, .6 } }, AspectRatio -> 2 / 3,
Frame -> True, FrameLabel -> { "GAINS", "LOSSES" } ] ;