Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

I'm trying to draw 3D plot from my experimental points in the way shown at the figure below:

enter image description here

I tried to use ListPointPlot3D for that, but obviously there is no option Joined as in ListPlot.

mydata = Table[{x, y, x*y*y}, {x, 0, 1, 0.03}, {y, 0, 10, 1}];
ListPointPlot3D[mydata, Filling -> Bottom, 
 ColorFunction -> Function[{x, y, z}, RGBColor[y, 0., 0.3]]]

So I obtained this:

enter image description here

Any idea how I can join the point to obtain the set of flat curves with filling?

share|improve this question

marked as duplicate by JasonB, MarcoB, RunnyKine, Louis, Jens Mar 31 at 15:43

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

up vote 2 down vote accepted

I don't see an easy way to do this with ListPointPlot3D or by layering a bunch of 2D ListPlots in a 3D box. However, it's fairly straightforward to do this manually, with basic graphics primitives. The shape of each curve is simply a polygon that traverses all the points in each row, but also includes one point at at z = 0 below the first and last point in the list. You'll just have to take care of colouring yourself:

color[n_] := With[{palette = ColorData[97, "ColorList"]},
  palette[[Mod[n, Length@palette, 1]]]
]
Graphics3D[
  MapIndexed[
    {
      Opacity@0.5,
      color@#2[[1]],
      Polygon[Join[#, {Last@#*{1, 1, 0}, First@#*{1, 1, 0}}]]
    } &,
    mydata
  ],
  BoxRatios -> {1, 1, 1/2},
  Axes -> True,
  Lighting -> "Neutral"
]

enter image description here

Note that this fills in the y-z planes. If you want to fill in the x-z planes instead, simply use Transpose @ mydata inside the MapIndexed instead:

enter image description here

share|improve this answer

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