Binary Plot

Author

Eric W. Weisstein
January 17, 2009

This notebook downloaded from http://mathworld.wolfram.com/notebooks/Graphics/BinaryPlot.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/BinaryPlot.html.

©2009 Wolfram Research, Inc. except for portions noted otherwise

Initialization

<<Utilities`Plot`

Usage

?NaryPlot

Examples

Integers

Show[PixelPerfect[NaryPlot[Range[0,255]],BlockSize->2]]

Show[PixelPerfect[NaryPlot[Range[0,255]^2],BlockSize->2]]

Show[PixelPerfect[NaryPlot[Fibonacci/@Range[0,255]],BlockSize->1]]

Flattened Number Triangle

NaryPlot[Flatten[Table[Binomial[n,k],{n,0,20},{k,0,n}]],Frame->False,ImageSize->600]

Fractions

Show[PixelPerfect[NaryPlot[Table[n/(n+1),{n,0,254}],2,2],BlockSize->2,
ColorFunction->(Switch[#,0,White,1,Black,2,Red]&), ColorFunctionScaling->False]]

Show[PixelPerfect[NaryPlot[Table[n/(2n+1),{n,255}],2,2],BlockSize->2,ColorFunction->(Switch[#,0,White,1,Black,2,Red]&), ColorFunctionScaling->False]]

Table[n/(2n+1),{n,10}]

Graphic

GraphicsGrid[List/@{
NaryPlot[Range[0,255],FrameLabel->Style[n,Black],FrameStyle->White,RotateLabel->False,ImageSize->400],
NaryPlot[Range[0,255]^2,FrameLabel->Style[n^2,Black],FrameStyle->White,RotateLabel->False,ImageSize->400],
NaryPlot[Fibonacci[Range[0,255]],FrameLabel->Style[Fibonacci[n],Black],FrameStyle->White,RotateLabel->False,ImageSize->400],
NaryPlot[Flatten[Table[Binomial[n,k],{n,0,20},{k,0,n}]],FrameLabel->Style[Binomial[n,k],Black],FrameStyle->White,RotateLabel->False,ImageSize->400]},
PlotRangePadding->None]