# 3d plot for function defined for integer values

I would like to make a plot of a function defined just for integer values, like

f[n_, m_] := 2 - (1/IntegerPart[n]) - (1/IntegerPart[m])


If I try to plot

Plot3D[f[n, m], {n, 1, 6}, {m, 1, 6}, PlotRange -> All,
PlotPoints -> 100, Exclusions -> None,
ColorFunction -> "BlueGreenYellow"]


I need this 100 points to get a "decent" result. This takes a long time, and the result is not very similar as the histogram one. Do you know if there is anyway to do this?

Thanks in advance!

• There's ListPointPlot3D and ListPlot3D. But I'm confused: If 1 <= n <=6 and 1 <= m <= 6 and n, m are integers, then there are only 36 points. – Michael E2 Apr 21 '13 at 22:47
• Sorry, I didn copied propperly, now is updated. THe problem in doing the ListPlot3D does only plot a point, I would like to have the chart bars aspect, like in the Histogram3D case. – pablo Apr 21 '13 at 22:53

## 1 Answer

Is this what you're after?

DiscretePlot3D[f[n, m], {n, 1, 6}, {m, 1, 6}, PlotRange -> All,
ColorFunction -> "BlueGreenYellow", ExtentSize -> Full] • Awesome! You saved my life! I million thanks ;) – pablo Apr 23 '13 at 21:57