Re: Plot a simple function

• To: mathgroup at smc.vnet.net
• Subject: [mg74875] Re: [mg74845] Plot a simple function
• From: Bob Hanlon <hanlonr at cox.net>
• Date: Mon, 9 Apr 2007 06:16:25 -0400 (EDT)

```H[p_] := -p*Log[2, p] -(1-p)*Log[2, 1-p] /; 0 <= p <= 1;

Plot[H[p],{p,0,1},
PlotStyle->{AbsoluteThickness[3],Blue},
Frame->True,
FrameTicks->{Range[0,1,0.5],Range[0,1,0.5],None,None},
FrameStyle->White,
FrameLabel->{"Pr(X = 1)","H(X)"},
AspectRatio->1,
TextStyle->{FontSize->18},
GridLines->Table[Table[
{x,{AbsoluteThickness[2],GrayLevel[0.9]}},
{x,0,1,0.1}],{2}],
Prolog->{Black,
AbsoluteThickness[2],
Line[{{0,1.05},{0,0},{1.05,0} }]}];

Bob Hanlon

---- "Paul K." <jorgecordero at gmail.com> wrote:
> Hi, a simple query. Do you know how could I plot the entropy function
> in Mathematica? I wish to produce an image similar to this one:
>
>
> Do you know how could I plot mutual information between two random
> variables X and Y in a 3D surface in Mathematica?
>
> Thanks!
>
> Paul.
>
>

```

• Prev by Date: NDSolve can't solve a complex ODE correctly?
• Next by Date: question
• Previous by thread: Plot a simple function
• Next by thread: Re: Plot a simple function