0
$\begingroup$

I'd like to create a picture for a Riemann sum for my Calculus class. I modified this example: http://reference.wolfram.com/language/example/Visualize3DRiemannSums.html#

and got this:

f = 20/(x^2 + y^2);
Grid[
 Partition[
  Table[
   Show[
    Quiet@DiscretePlot3D[f, {x, 1 + d/2, 2, d}, {y, 1 + d/2, 2, d},
      ExtentSize -> Full,
      FillingStyle -> Opacity[.6],
      PlotStyle -> RGBColor[0.19, 1., 0.16]
      ],
    PlotRange -> {{0, 2.3}, {0, 2.3}, {0, 10}},
    ViewPoint -> {2, .5, 1.2},
    Method -> {"AxesInFront" -> False},
    Axes -> True, AxesOrigin -> {0, 0, 0}, AxesLabel -> None, 
    AxesStyle -> Directive[Thickness[0.001], Orange],
    Lighting -> "Neutral",
    PlotRangePadding -> 0,
    ImageSize -> 500,
    Boxed -> False,
    AxesEdge -> {{1, -1}, {-1, -1}, {-1, 1}}],
   {d, {1/2, 1/4, 1/8, 1/16}}],
  2]
 ]

Unfortunately, the color for the plot is too dark, by some reason I can't make it lighter. Also, I do not like the axes in front of the picture. How can I fix that? enter image description here

I am open to all suggestions on this topic: choice of a function, choice of a region, colors, etc. I guess, ultimately, I'd like to create the following picture:

enter image description here

$\endgroup$
1
$\begingroup$

I think this could be a starting point:

f = 20/(x^2 + y^2);
GraphicsGrid[
Partition[
Show[{DiscretePlot3D[f, {x, 1 + #/2, 2, #}, {y, 1 + #/2, 2, #}, 
   ExtentSize -> Full, PlotStyle -> Cyan, 
   FillingStyle -> Opacity[1], 
   PlotRange -> {{0, 2.5}, {-1, 2.5}, {0, 12}}, Axes -> False, 
   AxesOrigin -> {0, 0, 0}, Ticks -> None, Boxed -> False, 
   ViewPoint -> {1.3, .7, .5}], 
  Graphics3D[{{Text[
      Style["x", 24, Italic, 
       FontFamily -> "Times New Roman"], {2.4, 0, 0}]}, {Text[
      Style["y", 24, Italic, FontFamily -> "Times New Roman"], {0,
        2.4, 0}]}, {Text[
      Style["z", 24, Italic, FontFamily -> "Times New Roman"], {0,
        0, 12}]},
    {Text[
      Style["O", 24, Italic, 
       FontFamily -> "Times New Roman"], {0, -.5, 0}]},
    {Arrowheads[.02], Thickness[0.007], 
     Arrow[{{0, 0, 0}, {0, 2.3, 0}}]}, {Arrowheads[.15], 
     Thickness[0.007], 
     Arrow[{{0, 0, 0}, {0, 0, 10}}]}, {Arrowheads[.02], 
     Thickness[0.007], Arrow[{{0, 0, 0}, {2.3, 0, 0}}]}}]}, 
 BoxRatios -> {1, 1, 0.4}] & /@ {1/2, 1/4, 1/8, 1/16}, 2], 
 ImageSize -> 1000]

enter image description here

You can modify the code according to your needs. Enjoy.

$\endgroup$
  • $\begingroup$ This looks great, thank you! $\endgroup$ – Alexander Ushakov Nov 21 '17 at 15:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.