# How to plot the sum of procedure's results in 3D?

**URL:** <https://community.wolfram.com/t/how-to-plot-the-sum-of-procedures-results-in-3d/5622>\
**Category:** Questions\
**Tags:** mathematica\
**Created:** [May 4, 2015, 11:29am UTC](https://community.wolfram.com/t/how-to-plot-the-sum-of-procedures-results-in-3d/5622 "2015-05-04T11:29:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![juliailkiv](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/juliailkiv/32/18030_2.png) [@juliailkiv](https://community.wolfram.com/u/juliailkiv)\
**Post date:** [May 4, 2015, 11:29am UTC](https://community.wolfram.com/t/how-to-plot-the-sum-of-procedures-results-in-3d/5622/1 "2015-05-04T11:29:30Z")

</div>

Hello!  
Help me please to draw a graph of the results of my procedure in 3D .  
The procedure displays a graph of the function Sin[x] and rectangles on it and Ln [y] and rectangles on it .  
I need to print a sum of procedsure’s results of Sin[x] and Ln[y] in 3D, then these rectangles should be parallelepipeds.

```
spxsin = {-1, -0.35, 0.3, 0.95, 1.6, 2.375, 3.15, 3.925, 4.7, 5.025, 
   5.35, 5.675, 6};
spxlny = {1, 2.25, 3.5, 4.75, 6};
operation[value_, f_, a_, b_] := Block[{data},
  data = Table[{x, f[x]}, {x, a, b, 0.1}];
  Graphics[{Thick, Blue, Line[data],
    Green, 
    Table[Point[{value[[i]], f[value[[i]]]}], {i, 1, Length[value]}], 
    Pink, Opacity[.7], 
    Table[Rectangle[{value[[i]], f[value[[i]]]}, {value[[i + 1]], 
       f[value[[i + 1]]]}], {i, 1, Length[value] - 1}]
    }, Axes -> True]]

operation[spxsin, Sin, -1, 6]
operation[spxlny, Log, 1, 6]

```

I’ve tried to do it :

```
Plot3D[{operation[spxsin, Sin, -1, 6] + operation[spxlny, Log, 1, 6]}, {spxsin, -1, 6}, {spxlny, 1, 6}]

```

or

```
Plot3D[{operation[spxsin, Sin, -1, 6] + operation[spxlny, Log, 1, 6]}, {x, -1, 6}, {y, 1, 6}]

```

but it doesn’t work:(

---

<div class="post-metadata">

**Author:** ![gianlucagorni](https://avatars.discourse-cdn.com/v4/letter/g/ec9cab/32.png) [@gianlucagorni](https://community.wolfram.com/u/gianlucagorni)\
**Post date:** [May 5, 2015, 10:51am UTC](https://community.wolfram.com/t/how-to-plot-the-sum-of-procedures-results-in-3d/5622/2 "2015-05-05T10:51:59Z")

</div>

I am afraid you’ll have to write a new operation3D routine. You cannot simply sum two 2D operations and hope that they give meaningful 3D results.
