({{, (RefLink[DiscretePlot3D, paclet:ref/DiscretePlot3D])[expr,{i,(Subscript[i, min]),(Subscript[i, max])},{j,(Subscript[j, min]),(Subscript[j, max])}] 
generates a plot of the values of expr when i runs from (Subscript[i, min]) to (Subscript[i, max]) and j runs from (Subscript[j, min]) to (Subscript[j, max]).}, {, (RefLink[DiscretePlot3D, paclet:ref/DiscretePlot3D])[expr,{i,(Subscript[i, min]),(Subscript[i, max]),di},{j,(Subscript[j, min]),(Subscript[j, max]),dj}]
uses steps di and dj.}, {, (RefLink[DiscretePlot3D, paclet:ref/DiscretePlot3D])[expr,{i,{(Subscript[i, 1]),(Subscript[i, 2]),…}},{j,{(Subscript[j, 1]),(Subscript[j, 2]),…}}]
uses successive i values (Subscript[i, 1]), (Subscript[i, 2]), … and j values (Subscript[j, 1]),  (Subscript[j, 2]), …. }, {, (RefLink[DiscretePlot3D, paclet:ref/DiscretePlot3D])[{(Subscript[expr, 1]),(Subscript[expr, 2]),…},…,…]
plots the values of all the (Subscript[expr, i]).}})

OpenersNotesSection(Spacer1)Details and Options

(RefLink[DiscretePlot3D, paclet:ref/DiscretePlot3D]) uses the standard Wolfram Language iterator specification.

(RefLink[DiscretePlot3D, paclet:ref/DiscretePlot3D]) plots the variable i along the x axis and j along the y axis.

(RefLink[DiscretePlot3D, paclet:ref/DiscretePlot3D]) treats the variables i and j as local, effectively using (RefLink[Block, paclet:ref/Block]).

(RefLink[DiscretePlot3D, paclet:ref/DiscretePlot3D]) has attribute (RefLink[HoldAll, paclet:ref/HoldAll]), and evaluates expr only after assigning specific numerical values to i and j.

In some cases, it may be more efficient to use (RefLink[Evaluate, paclet:ref/Evaluate]) to evaluate expr symbolically before specific numerical values are assigned to i and j.

The precision used in evaluating expr is the minimum precision used in the iterators.

The form w[expr] provides a wrapper w to be applied to the resulting graphics primitives.

The following wrappers can be used:

(RefLink[Callout, paclet:ref/Callout]) and (RefLink[Labeled, paclet:ref/Labeled]) can use the following positions pos:

Labels that depend on n will be applied for each plot element, while labels that are independent of n will only occur once.

(RefLink[DiscretePlot3D, paclet:ref/DiscretePlot3D]) has the same options as (RefLink[Graphics3D, paclet:ref/Graphics3D]), with the following additions and changes:

The arguments supplied to (RefLink[ColorFunction, paclet:ref/ColorFunction]) are x, y, z.

With the setting (RefLink[ExtentSize, paclet:ref/ExtentSize])->{{(Subscript[sx, l]),(Subscript[sx, r])},{(Subscript[sy, l]),(Subscript[sy, r])}} a horizontal plane is drawn around each plot point extending (Subscript[sx, l]) to the left and (Subscript[sx, r]) to the right along the x axis and (Subscript[sy, l]) to the left and (Subscript[sy, r]) to the right along the y axis. With (RefLink[ExtentMarkers, paclet:ref/ExtentMarkers])->{{(Subscript[mx, l]),(Subscript[mx, r])},{(Subscript[my, l]),(Subscript[my, r])}}, the markers (Subscript[mx, l]) and (Subscript[mx, r]) will be used as left and right markers along the x axis and (Subscript[my, l]) and (Subscript[my, r]) as left and right markers along the y axis.

The arguments supplied to (RefLink[ExtentElementFunction, paclet:ref/ExtentElementFunction]) are the element region {{(Subscript[x, min]),(Subscript[x, max])},{(Subscript[y, min]),(Subscript[y, max])},{(Subscript[z, min]),(Subscript[z, max])}} and the sample point {(Subscript[x, i]),(Subscript[y, i]),(Subscript[z, i])}.

With the setting (RefLink[ExtentSize, paclet:ref/ExtentSize])->(RefLink[None, paclet:ref/None]), (Subscript[x, min]) is equal to (Subscript[x, max]) and (Subscript[y, min]) is equal to (Subscript[y, max]). With the setting (RefLink[Filling, paclet:ref/Filling])->(RefLink[None, paclet:ref/None]), (Subscript[z, min]) is equal to (Subscript[z, max]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (93)

OpenersExampleSection0(Spacer1)Basic Examples  (3)

Plot a bivariate sequence:

DiscretePlot3D[PDF[MultivariatePoissonDistribution[3,{1,1}],{t,u}],{t,0,10},{u,0,10}]

Associate a region with the points:

DiscretePlot3D[PDF[MultivariatePoissonDistribution[3,{1,1}],{t,u}],{t,0,10},{u,0,10},ExtentSize->Full]

Plot several sequences:

DiscretePlot3D[{PDF[MultivariatePoissonDistribution[3,{1,1}],{t,u}],PDF[MultivariatePoissonDistribution[5,{2,2}],{t,u}]},{t,0,10},{u,0,10},ExtentSize->Full]

OpenersExampleSection1(Spacer1)Scope  (12)

OpenersExampleSubsection0(Spacer1)Data and Layouts  (4)

Plot multiple datasets:

DiscretePlot3D[{Sin[t +u],Cos[t+ u]},{t,0,2Pi,Pi/12},{u,0,2Pi,Pi/12},ExtentSize->Full]

Use wrappers on individual data, datasets, or collections of datasets:

{DiscretePlot3D[{Sin[t+u],Cos[t+u]},{t,0,2*Pi, Pi/6},{u,0,2*Pi, Pi/6},ExtentSize->Full],DiscretePlot3D[{Sin[t+u],Style[Cos[t+u],Green]},{t,0,2*Pi, Pi/6},{u,0,2*Pi, Pi/6},ExtentSize->Full],DiscretePlot3D[Style[{Sin[t+u],Cos[t+u]},Green],{t,0,2*Pi, Pi/6},{u,0,2*Pi, Pi/6},ExtentSize->Full]}

Wrappers can be nested:

DiscretePlot3D[Style[{Sin[t+u],Style[Cos[t+u],Green]},Red],{t,0,2*Pi, Pi/12},{u,0,2*Pi, Pi/12},ExtentSize->Full]

Override the default tooltips:

DiscretePlot3D[{Sin[t+u],Tooltip[Cos[t+u],"my data"]},{t,0,2*Pi, Pi/12},{u,0,2*Pi, Pi/12},ExtentSize->Full]

Use (RefLink[PopupWindow, paclet:ref/PopupWindow]) to provide additional drilldown information:

DiscretePlot3D[PopupWindow[PDF[MultivariatePoissonDistribution[3,{1,1}],{t,u}],TraditionalForm[PDF[MultivariatePoissonDistribution[3,{1,1}],{t,u}]]],{t,0,10},{u,0,10},ExtentSize->Full]

(RefLink[Button, paclet:ref/Button]) can be used to trigger any action:

DiscretePlot3D[Evaluate@Table[With[{lambda=λ},Button[PDF[
      MultivariatePoissonDistribution[lambda,{1,1}], {t,u}], 
  Speak[MultivariatePoissonDistribution[lambda,{1,1}]]]],{λ,{1,2,3}}], 
  {t, 0, 10},{u,0,10},PlotRange->All,ExtentSize->Full]

Use (RefLink[ScalingFunctions, paclet:ref/ScalingFunctions]) to scale the axes:

DiscretePlot3D[LCM[x,y],{x,20},{y,20},ExtentSize->Full,ScalingFunctions->"Log"]

OpenersExampleSubsection1(Spacer1)Labeling and Legending  (3)

Label individual points:

DiscretePlot3D[Callout[GCD[x,y],If[x==y,x,None],Above],{x,Prime[Range[10]]},{y,Prime[Range[10]]}]

Use tooltips instead:

DiscretePlot3D[Tooltip[GCD[x,y],GCD[x,y]],{x,Prime[Range[10]]},{y,Prime[Range[10]]}]

Specify label names with (RefLink[LabelingFunction, paclet:ref/LabelingFunction]):

DiscretePlot3D[GCD[x,y],{x,1,5},{y,1,5},LabelingFunction->(#1[[1]] &)]

DiscretePlot3D[Callout[GCD[x,y], IntegerName@GCD[x,y]],{x,1,5},{y,1,5}]

OpenersExampleSubsection2(Spacer1)Styling and Appearance  (5)

Use (RefLink[ExtentSize, paclet:ref/ExtentSize]) to associate a region with a point:

Table[DiscretePlot3D[PDF[MultivariatePoissonDistribution[3,{1,1}],{t,u}],{t,0,10},{u,0,10},ExtentSize->s,PlotLabel->s],{s,{None,Full,Right,Scaled[0.5]}}]

Use an explicit list of styles for the plots:

DiscretePlot3D[{Sin[t+u],Cos[t+u]},{t,0,2*Pi},{u,0,2*Pi},PlotStyle->{Red,Blue},ExtentSize->Full]

Use any gradient color schemes from (RefLink[ColorData, paclet:ref/ColorData]):

{DiscretePlot3D[{Sin[t+u],Cos[t+u]},{t,0,2*Pi},{u,0,2*Pi},ColorFunction->"Pastel",ExtentSize->Full],DiscretePlot3D[{Sin[t+u],Cos[t+u]},{t,0,2*Pi},{u,0,2*Pi},ColorFunction->Function[{x,y},ColorData["NeonColors"][y]],ExtentSize->Full]}

(RefLink[Style, paclet:ref/Style]) can be used to override styles:

DiscretePlot3D[{Sin[t+u],Style[Cos[t+u],Red]},{t,0,2*Pi},{u,0,2*Pi},PlotStyle->Gray,ExtentSize->Full]

Show plot markers:

DiscretePlot3D[Exp[-x^2-y^2],{x,-3,3,0.25},{y,-3,3,0.25},PlotMarkers->"Sphere"]

Show extent region boundaries:

DiscretePlot3D[PDF[MultivariatePoissonDistribution[3,{1,1}],{t,u}],{t,10},{u,10},ColorFunction->"Rainbow",ExtentSize->Full,ExtentMarkers->"Tube"]

DiscretePlot3D[PDF[MultivariatePoissonDistribution[3,{1,1}],{t,u}],{t,10},{u,10},ExtentSize->Full,ColorFunction->"DarkRainbow",ExtentMarkers->{{"Tube",None},{"Tube",None}}]

Use a theme with dark background in a high-contrast color scheme:

DiscretePlot3D[Mod[x,y],{x,10},{y,10},PlotTheme->"Marketing"]

OpenersExampleSection2(Spacer1)Options  (72)

OpenersExampleSubsection3(Spacer1)AxesLabel  (2)

Use labels based on variables specified in (RefLink[DiscretePlot3D, paclet:ref/DiscretePlot3D]):

DiscretePlot3D[Mod[x,y],{x,10},{y,10},ExtentSize->Full,AxesLabel->Automatic]

Specify a label for each axis:

DiscretePlot3D[Mod[x,y],{x,10},{y,10},ExtentSize->Full,AxesLabel->{x,y,Mod[x,y]}]

OpenersExampleSubsection4(Spacer1)ColorFunction  (6)

Color the points by scaled x, y, or z value:

Map[DiscretePlot3D[PDF[MultivariatePoissonDistribution[5,{2,3}],{x,y}],{x,0,15},{y,0,15},ColorFunction->Function[{x,y,z},#],PlotLabel->#]&,{Hue[x],Hue[y],Hue[z]}]

Color the surface by scaled x, y, or z value:

Map[DiscretePlot3D[PDF[MultivariatePoissonDistribution[5,{2,3}],{x,y}],{x,0,15},{y,0,15},Joined->True,PlotRange->All,ColorFunction->Function[{x,y,z},#],PlotLabel->#]&,{Hue[x],Hue[y],Hue[z]}]

Color the regions by scaled x, y, or z value:

Map[DiscretePlot3D[PDF[MultivariatePoissonDistribution[5,{2,3}],{x,y}],{x,0,15},{y,0,15},ExtentSize->Full,ColorFunction->Function[{x,y,z},#],PlotLabel->#]&,{Hue[x],Hue[y],Hue[z]}]

Use a named color gradient:

DiscretePlot3D[PDF[MultivariatePoissonDistribution[1,{1,1}],{x,y}],{x,0,15},{y,0,15},ExtentSize->Full,ColorFunction->"Rainbow"]

(RefLink[ColorFunction, paclet:ref/ColorFunction]) has higher priority than (RefLink[PlotStyle, paclet:ref/PlotStyle]):

DiscretePlot3D[PDF[MultivariatePoissonDistribution[5,{2,3}],{x,y}],{x,0,15},{y,0,15},ColorFunction->"Rainbow",PlotStyle->Directive[Red,PointSize[Large]]]

Use black when two numbers are relatively prime:

DiscretePlot3D[GCD[m,n],{m,1,20},{n,1,20},ExtentSize->Full,ColorFunction->Function[{x,y,z},If[z==1,Black,Hue[z/20]]],ColorFunctionScaling->False]

OpenersExampleSubsection5(Spacer1)ColorFunctionScaling  (1)

Color by absolute height:

DiscretePlot3D[PDF[MultivariatePoissonDistribution[1,{1,1}],{x,y}],{x,0,10},{y,0,10},ExtentSize->Full,ColorFunction->Function[{x,y,z},Hue[z]],ColorFunctionScaling->False]

OpenersExampleSubsection6(Spacer1)EvaluationMonitor  (1)

Gather the plotted heights:

{plot,points}=Reap[DiscretePlot3D[LCM[n,m],{m,20},{n,20},EvaluationMonitor:>Sow[LCM[n,m]],ExtentSize->Full]];

Show the plot and a histogram of the heights:

{plot, Histogram[points]}

OpenersExampleSubsection7(Spacer1)ExtentElementFunction  (5)

Get a list of built-in settings for (RefLink[ExtentElementFunction, paclet:ref/ExtentElementFunction]):

ChartElementData["DiscretePlot3D"]

For detailed settings, use Palettes ▶ Chart Element Schemes:

Table[DiscretePlot3D[PDF[MultivariatePoissonDistribution[1,{1,1}],{x,y}],{x,0,8},{y,0,8},ExtentSize->Full,ExtentElementFunction->f],{f,{"Cone","Cube","Cylinder","PlaneFadingCube"}}]

Table[DiscretePlot3D[PDF[MultivariatePoissonDistribution[1,{1,1}],{x,y}],{x,0,8},{y,0,8},ExtentSize->Full,ExtentElementFunction->f],{f,{"ProfileCube","DoubleProfileCube","SquareWaveCube","TriangleWaveCube"}}]

This (RefLink[ChartElementFunction, paclet:ref/ChartElementFunction]) is appropriate to show the global scale:

Table[DiscretePlot3D[PDF[MultivariatePoissonDistribution[1,{1,1}],{x,y}],{x,0,8},{y,0,8},ExtentSize->Full,ExtentElementFunction->f],{f,{"GradientScaleCube","SegmentScaleCube"}}]

Write a custom (RefLink[ExtentElementFunction, paclet:ref/ExtentElementFunction]):

vase[{{xmin_,xmax_},{ymin_,ymax_},{zmin_,zmax_}},___]:={CapForm[None],Tube[
Table[{(xmin+xmax)/2,(ymin+ymax)/2,z},{z,zmin,zmax,(zmax-zmin)/15}],
Join[Sort[RandomReal[(xmax-xmin){0.1,0.5},8],Less],Sort[RandomReal[(xmax-xmin){0.1,0.5},8],Greater]]]}

DiscretePlot3D[PDF[MultivariatePoissonDistribution[1,{1,1}],{x,y}],{x,0,5},{y,0,5},ExtentSize->Full,ExtentElementFunction->vase,PlotRange->{0,0.1}]

A built-in element function may have options; use Palettes ▶ Chart Element Schemes to set them:

ChartElementData["ProfileCube","Options"]

Table[DiscretePlot3D[PDF[MultivariatePoissonDistribution[1,{1,1}],{x,y}],{x,0,5},{y,0,5},ExtentSize->Full,ExtentElementFunction->ChartElementData["ProfileCube","Profile"->p,"TaperRatio"->r]],{p,{0.1,1,5}},{r,{0,0.5,1}}]

OpenersExampleSubsection8(Spacer1)ExtentMarkers  (4)

Do not show the extent edges:

DiscretePlot3D[LCM[m,n],{m,6},{n,6},ExtentSize->Full,ExtentMarkers->None,PlotStyle->EdgeForm[]]

Use lines to show the extent edges:

DiscretePlot3D[LCM[m,n],{m,6},{n,6},ExtentSize->Full,ExtentMarkers->{"Line",5},PlotStyle->EdgeForm[]]

Use varying sized tubes to show the extent edges:

Table[DiscretePlot3D[LCM[m,n],{m,5},{n,5},ExtentSize->Full,ExtentMarkers->{"Tube",size}],{size,{Tiny,Small,Medium,Large}}]

Place tubes along the front and left edges of the extent region:

DiscretePlot3D[LCM[m,n],{m,5},{n,5},ExtentSize->Full,ExtentMarkers->{{"Tube",None},{"Tube",None}}]

OpenersExampleSubsection9(Spacer1)ExtentSize  (6)

Show heights as points:

DiscretePlot3D[LCM[m,n],{m,5},{n,5},ExtentSize->None]

Draw full regions around the heights:

DiscretePlot3D[LCM[m,n],{m,5},{n,5},ExtentSize->Full]

With unevenly spaced points:

DiscretePlot3D[LCM[m,n],{m,{1,2,3,5,8,13}},{n,{1,2,3,5,8,13}},ExtentSize->Full]

Use fixed-size regions:

DiscretePlot3D[LCM[m,n],{m,5},{n,5},ExtentSize->0.5]

With unevenly spaced points:

DiscretePlot3D[LCM[m,n],{m,{1,2,3,5,8,13}},{n,{1,2,3,5,8,13}},ExtentSize->0.5]

Use sizes relative to the distance between points:

DiscretePlot3D[LCM[m,n],{m,5},{n,5},ExtentSize->Scaled[0.75]]

With unevenly spaced points:

DiscretePlot3D[LCM[m,n],{m,{1,2,3,5,8,13}},{n,{1,2,3,5,8,13}},ExtentSize->Scaled[0.75]]

Use equally sized regions that do not overlap:

DiscretePlot3D[LCM[m,n],{m,5},{n,5},ExtentSize->All]

With unevenly spaced points:

DiscretePlot3D[LCM[m,n],{m,{1,2,3,5,8,13}},{n,{1,2,3,5,8,13}},ExtentSize->All]

Control the placement of the region around the points:

Table[DiscretePlot3D[LCM[m,n],{m,5},{n,5},ExtentSize->es,PlotLabel->es,PlotMarkers->{"Sphere",Large}],{es,{{{None,Full},{None,Full}},{{Full,None},{Full,None}}}}]

OpenersExampleSubsection10(Spacer1)Filling  (3)

(RefLink[DiscretePlot3D, paclet:ref/DiscretePlot3D]) fills to z==0:

Table[DiscretePlot3D[Mod[m,n],{m,15},{n,15},Evaluate[opt]],{opt,{Joined->False,Joined->True,ExtentSize->Full}}]

Turn off filling:

Table[DiscretePlot3D[Mod[m,n],{m,15},{n,15},Filling->None,Evaluate[opt]],{opt,{Joined->False,Joined->True,ExtentSize->Full}}]

Fill to different levels:

Table[DiscretePlot3D[Mod[m,n]-Mod[n,m],{m,15},{n,15},Filling->fill,PlotLabel->fill],{fill,{Bottom,Top,Axis,-20}}]

OpenersExampleSubsection11(Spacer1)FillingStyle  (3)

Fill to the bottom with a variety of styles:

Table[DiscretePlot3D[Mod[m,n]-Mod[n,m],{m,15},{n,15},Filling->Bottom,FillingStyle->fs],{fs,{Opacity[1],Red,Dashed,Thick}}]

With expanded point regions:

Table[DiscretePlot3D[Mod[m,n]-Mod[n,m],{m,15},{n,15},ExtentSize->Full,Filling->Bottom,FillingStyle->fs],{fs,{Opacity[1],Red}}]

Use different colors above and below the filling level:

Table[DiscretePlot3D[Mod[m,n]-Mod[n,m],{m,15},{n,15},ExtentSize->es,Filling->Axis,FillingStyle->{Red,Blue}],{es,{None,Full}}]

Only fill below the filling level:

Table[DiscretePlot3D[Mod[m,n]-Mod[n,m],{m,15},{n,15},ExtentSize->es,Filling->Axis,FillingStyle->{Red,None}],{es,{None,Full}}]

OpenersExampleSubsection12(Spacer1)Joined  (2)

Join the points into a surface:

DiscretePlot3D[PDF[MultivariatePoissonDistribution[5,{2,3}],{x,y}],{x,0,15},{y,0,15},Joined->True]

Combine a surface with extent regions:

DiscretePlot3D[PDF[MultivariatePoissonDistribution[5,{2,3}],{x,y}],{x,0,15},{y,0,15},Joined->True,ExtentSize->Full]

OpenersExampleSubsection13(Spacer1)LabelingFunction  (4)

Put the labels above the points:

DiscretePlot3D[GCD[x,y],{x,1,5},{y,1,5},LabelingFunction->Above]

Put them in a tooltip:

DiscretePlot3D[GCD[x,y],{x,1,5},{y,1,5},LabelingFunction->Tooltip]

Use callouts to label the points:

DiscretePlot3D[GCD[x,y],{x,1,5},{y,1,5},LabelingFunction->Callout[Automatic,Automatic]]

Label the points with their values:

DiscretePlot3D[GCD[x,y],{x,1,5},{y,1,5},LabelingFunction->(#1&)]

Label the points with their indices:

DiscretePlot3D[GCD[x,y],{x,1,5},{y,1,5},LabelingFunction->(#2&)]

OpenersExampleSubsection14(Spacer1)LabelingSize  (1)

Specify a maximum size for textual labels:

DiscretePlot3D[Callout[GCD[x,y],IntegerName[x]],{x,500,505},{y,500,505},ImageSize->Medium,LabelingSize->30]

Use the full label:

DiscretePlot3D[Callout[x+y,IntegerName[x+y]],{x,0,10},{y,0,10},ImageSize->Medium,LabelingSize->Full]

OpenersExampleSubsection15(Spacer1)PlotMarkers  (4)

Change the size of the default plot markers:

Table[DiscretePlot3D[PDF[MultivariatePoissonDistribution[5,{2,3}],{x,y}],{x,0,15},{y,0,15},PlotMarkers->{Automatic,s}],{s,{Tiny,Small,Medium,Large}}]

Markers are not usually shown when surfaces are used:

{DiscretePlot3D[PDF[MultivariatePoissonDistribution[5,{2,3}],{x,y}],{x,0,15},{y,0,15},Joined->True],DiscretePlot3D[PDF[MultivariatePoissonDistribution[5,{2,3}],{x,y}],{x,0,15},{y,0,15},ExtentSize->Full]}

Use points with surfaces:

{DiscretePlot3D[PDF[MultivariatePoissonDistribution[5,{2,3}],{x,y}],{x,0,15},{y,0,15},Joined->True,PlotMarkers->"Point",PlotStyle->FaceForm[Lighter[Blue,0.5]]],DiscretePlot3D[PDF[MultivariatePoissonDistribution[5,{2,3}],{x,y}],{x,0,15},{y,0,15},ExtentSize->Full,PlotMarkers->"Point"]}

Use spheres for markers:

{DiscretePlot3D[PDF[MultivariatePoissonDistribution[5,{2,3}],{x,y}],{x,0,15},{y,0,15},PlotMarkers->"Sphere"],DiscretePlot3D[PDF[MultivariatePoissonDistribution[5,{2,3}],{x,y}],{x,0,15},{y,0,15},ExtentSize->Full,PlotMarkers->"Sphere"]}

Vary the size of the spheres:

Table[DiscretePlot3D[PDF[MultivariatePoissonDistribution[5,{2,3}],{x,y}],{x,0,15},{y,0,15},PlotMarkers->{"Sphere",s}],{s,{Tiny,Small,Medium,Large}}]

OpenersExampleSubsection16(Spacer1)PlotLegends  (6)

Use automatic legends:

DiscretePlot3D[{Sin[x +y],Cos[x+y]},{x,20},{y,20},ExtentSize->Full,PlotLegends->Automatic]

Specify a list of labels for legends:

DiscretePlot3D[{x,y},{x,20},{y,20},ExtentSize->Full,PlotLegends->{"label1","label2"}]

Use named legends:

DiscretePlot3D[{Sin[x +y],Sin[x-y]},{x,20},{y,20},ExtentSize->Full,PlotLegends->"Expressions"]

(RefLink[PlotLegends, paclet:ref/PlotLegends]) automatically picks up (RefLink[PlotStyle, paclet:ref/PlotStyle]) values:

DiscretePlot3D[{Sin[(x +y)^2],Sin[(x -y)^2]},{x,0,2,0.2},{y,0,2,0.2},ExtentSize->Full,PlotStyle->{Red,Blue},PlotLegends->"Expressions"]

Use (RefLink[Placed, paclet:ref/Placed]) to control legend placement:

Table[DiscretePlot3D[{Sin[(x +y)],Sin[(x -y)]},{x,0,2,0.2},{y,0,2,0.2},ExtentSize->Full,PlotStyle->{Orange,Blue},PlotLegends->Placed["Expressions",pos]],{pos,{Above,Below}}]

Use (RefLink[SwatchLegend, paclet:ref/SwatchLegend]) to change legend appearance:

DiscretePlot3D[{Sin[(x +y)^2],Sin[(x -y)^2]},{x,0,2,0.2},{y,0,2,0.2},ExtentSize->Full,PlotStyle->{Red,Blue},PlotLegends->SwatchLegend["Expressions",LegendLabel->"label",LegendFunction->(Framed[#,RoundingRadius->5]&)]]

OpenersExampleSubsection17(Spacer1)PlotStyle  (7)

Use different style directives:

Table[DiscretePlot3D[PDF[MultivariatePoissonDistribution[5,{2,3}],{x,y}],{x,0,15},{y,0,15},PlotStyle->ps],{ps,{Red,PointSize[0.025],Darker[Green],Directive[Red,PointSize[Small]]}}]

By default, different styles are chosen for multiple functions:

DiscretePlot3D[Evaluate[Table[PDF[MultivariatePoissonDistribution[2k,{k,3k}],{x,y}],{k,3}]],{x,20},{y,20},ExtentSize->Full]

Explicitly specify the style for different functions:

DiscretePlot3D[Evaluate[Table[PDF[MultivariatePoissonDistribution[2k,{k,3k}],{x,y}],{k,3}]],{x,20},{y,20},ExtentSize->Full,PlotStyle->{Red,Orange,Blue}]

(RefLink[PlotStyle, paclet:ref/PlotStyle]) applies to points, lines, and surfaces:

DiscretePlot3D[PDF[MultivariatePoissonDistribution[5,{2,3}],{x,y}],{x,0,15},{y,0,15},PlotStyle->Red]

DiscretePlot3D[PDF[MultivariatePoissonDistribution[5,{2,3}],{x,y}],{x,0,15},{y,0,15},ExtentSize->Full,PlotStyle->Directive[Orange,EdgeForm[Blue]]]

(RefLink[PlotStyle, paclet:ref/PlotStyle]) can be combined with (RefLink[ColorFunction, paclet:ref/ColorFunction]):

DiscretePlot3D[PDF[MultivariatePoissonDistribution[5,{2,3}],{x,y}],{x,0,15},{y,0,15},PlotStyle->PointSize[Medium],ColorFunction->Function[{x,y,z},Hue[z]]]

(RefLink[PlotStyle, paclet:ref/PlotStyle]) can be combined with (RefLink[FillingStyle, paclet:ref/FillingStyle]):

DiscretePlot3D[PDF[MultivariatePoissonDistribution[5,{2,3}],{x,y}],{x,0,15},{y,0,15},PlotStyle->Red,FillingStyle->Opacity[1]]

(RefLink[FillingStyle, paclet:ref/FillingStyle]) by default uses the same style as (RefLink[PlotStyle, paclet:ref/PlotStyle]) with transparency:

DiscretePlot3D[PDF[MultivariatePoissonDistribution[5,{2,3}],{x,y}],{x,0,15},{y,0,15},PlotStyle->Red]

OpenersExampleSubsection18(Spacer1)PlotTheme  (4)

Use a theme with simple ticks and grid lines:

DiscretePlot3D[{CDF[MultivariatePoissonDistribution[3,{1,1}],{t,u}],SurvivalFunction[MultivariatePoissonDistribution[3,{1,1}],{t,u}]},{t,10},{u,10},PlotTheme->"Business"]

Change the color scheme:

DiscretePlot3D[{CDF[MultivariatePoissonDistribution[3,{1,1}],{t,u}],SurvivalFunction[MultivariatePoissonDistribution[3,{1,1}],{t,u}]},{t,10},{u,10},PlotTheme->"Business",PlotStyle->{Red,Blue}]

Use a theme with dark background in a high-contrast color scheme:

DiscretePlot3D[GCD[m,n],{m,15},{n,15},PlotTheme->"Marketing"]

Turn off the ticks:

DiscretePlot3D[GCD[m,n],{m,15},{n,15},PlotTheme->"Marketing",Ticks->None]

OpenersExampleSubsection19(Spacer1)RegionFunction  (4)

Restrict the region plotted:

DiscretePlot3D[GCD[m,n],{m,25},{n,25},RegionFunction->Function[{m,n,z},m≤n]]

Extended regions are treated as the underlying point without additional clipping:

DiscretePlot3D[GCD[m,n],{m,5},{n,5},ExtentSize->Full,RegionFunction->Function[{m,n,z},m<=n],PlotMarkers->"Sphere"]

Regions can have several unconnected components:

DiscretePlot3D[GCD[m,n],{m,25},{n,25},RegionFunction->Function[{m,n,z},Mod[m+n,10]≤7]]

Define regions using logical combinations of constraints:

DiscretePlot3D[GCD[m,n],{m,25},{n,25},RegionFunction->Function[{m,n,z},m^2+n^2≤625&&m+n≥25]]

OpenersExampleSubsection20(Spacer1)ScalingFunctions  (9)

By default, plots have linear scales in each direction:

DiscretePlot3D[Max[x,y],{x,0,10,.5},{y,0,10,.5},ExtentSize->Full]

Use a log scale in the z direction:

DiscretePlot3D[Max[x,y],{x,1,10,.5},{y,1,10,.5},ExtentSize->Full,ScalingFunctions->"Log"]

Use a linear scale in the y direction that shows smaller numbers at the front:

DiscretePlot3D[Max[x,y],{x,0,10,.5},{y,0,10,.5},ExtentSize->Full,ScalingFunctions->{None,"Reverse"}]

Use a reciprocal scale in the y direction:

DiscretePlot3D[Max[x,y],{x,1,10,.5},{y,1,10,.5},ExtentSize->Full,ScalingFunctions->{None,"Reciprocal"}]

Use different scales in the x and y directions:

DiscretePlot3D[Max[x,y],{x,0,10,.5},{y,0,10,.5},ExtentSize->Full,ScalingFunctions->{"Reverse","Log"}]

Reverse the x axis without changing the y axis:

DiscretePlot3D[Max[x,y],{x,0,10,.5},{y,0,10,.5},ExtentSize->Full,ScalingFunctions->{"Reverse",None}]

Use a y scale defined by a function and its inverse:

DiscretePlot3D[Max[x,y],{x,0,10,.5},{y,0,10,.5},ExtentSize->Full,ScalingFunctions->{None,{-Log[#]&,Exp[-#]&}}]

Positions in (RefLink[Ticks, paclet:ref/Ticks]) and (RefLink[FaceGrids, paclet:ref/FaceGrids]) are automatically scaled:

DiscretePlot3D[u+t^2,{t,0.01,50},{u,0,10},ExtentSize->Full,ScalingFunctions->{"Log",None},Ticks->{2^Range[10],Automatic,Automatic},FaceGrids->All]

(RefLink[PlotRange, paclet:ref/PlotRange]) is automatically scaled:

DiscretePlot3D[LCM[m,n],{m,50},{n,50},ExtentSize->Full,ScalingFunctions->"Log",PlotRange->{100,1000}]

OpenersExampleSection3(Spacer1)Applications  (2)

Visualize properties of discrete distributions, such as probability density function:

Table[DiscretePlot3D[PDF[MultivariatePoissonDistribution[μ,{2,3}],{x,y}],{x,0,15},{y,0,15},ExtentSize->0.5,PlotLabel->Row[{"μ = ",μ}]],{μ,{1,5}}]

Cumulative distribution function:

Table[DiscretePlot3D[CDF[MultivariatePoissonDistribution[μ,{2,3}],{x,y}],{x,0,15},{y,0,15},PlotStyle->Purple,ExtentSize->Right,PlotLabel->Row[{"μ = ",μ}]],{μ,{1,5}}]

Survival function:

Table[DiscretePlot3D[SurvivalFunction[MultivariatePoissonDistribution[μ,{2,3}],{x,y}],{x,0,15},{y,0,15},PlotStyle->Orange,ExtentSize->Right,PlotLabel->Row[{"μ = ",μ}]],{μ,{1,5}}]

Approximate the volume under a surface using Riemann sums:

plot=Plot3D[PDF[BinormalDistribution[0.5],{x,y}],{x,-2,2},{y,-2,2},PlotStyle->Directive[Opacity[0.4],Yellow],RegionFunction->(#<0||#2>0&)]

riemann=DiscretePlot3D[PDF[BinormalDistribution[0.5],{x,y}],{x,-2,2,0.5},{y,-2,2,0.5},ExtentSize->Full,RegionFunction->(#<0||#2>0&)]

Show[plot,riemann]

OpenersExampleSection4(Spacer1)Properties & Relations  (4)

(RefLink[Plot3D, paclet:ref/Plot3D]) generates continuous surfaces:

Plot3D[PDF[BinormalDistribution[0.5],{x,y}],{x,-2,2},{y,-2,2}]

Use (RefLink[ListPointPlot3D, paclet:ref/ListPointPlot3D]) to plot lists of values:

{ListPointPlot3D[Table[Table[x+y,{x,10}],{y,10}]],DiscretePlot3D[x+y,{x,10},{y,10}]}

Use (RefLink[BarChart3D, paclet:ref/BarChart3D]) to show bars for lists of values:

{BarChart3D[Table[Table[x+y,{x,10}],{y,10}],ChartLayout->"Grid"],DiscretePlot3D[x+y,{x,10},{y,10},ExtentSize->Full]}

Use (RefLink[DiscretePlot, paclet:ref/DiscretePlot]) to plot functions of single discrete variables:

DiscretePlot[PDF[PoissonDistribution[4],x],{x,0,10},ExtentSize->Scaled[0.5]]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[ListPointPlot3D, paclet:ref/ListPointPlot3D])  ▪  (RefLink[ListPlot3D, paclet:ref/ListPlot3D])  ▪  (RefLink[ListDensityPlot, paclet:ref/ListDensityPlot])  ▪  (RefLink[ListContourPlot, paclet:ref/ListContourPlot])  ▪  (RefLink[Plot3D, paclet:ref/Plot3D])  ▪  (RefLink[ArrayPlot, paclet:ref/ArrayPlot])  ▪  (RefLink[MatrixPlot, paclet:ref/MatrixPlot])  ▪  (RefLink[Table, paclet:ref/Table])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Function Visualization, paclet:guide/FunctionVisualization])}, {▪(RefLinkPlain[Discrete Calculus, paclet:guide/DiscreteCalculus])}, {▪(RefLinkPlain[Statistical Visualization, paclet:guide/StatisticalVisualization])}})}})