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)
- Reply-to: hanlonr at cox.net
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:
>
> http://upload.wikimedia.org/wikipedia/commons/c/c9/Binary_entropy_plot.png
>
> Do you know how could I plot mutual information between two random
> variables X and Y in a 3D surface in Mathematica?
>
> Thanks!
>
> Paul.
>
>