After converting a figure to TeX using matlab2tikz, I figured there's a little problem.

The figure consists of many lines, but there are two different sets of lines

  • a cloud set, forming a stream
  • and a border set, surrounding this stream

The both set are plotted by two \addplot3 commands. The problem is, that lines of the border set are drawn right on top of the first \addplot3, like another layer (img1). But actually some of those lines should be hidden partially by the stream (img2).

Manipulating the original function would be quite laborious, if at all possible. Is there any other way to fix this?

(img1) tex

enter image description here

(img2) matlab

enter image description here

  • This is not possible with PGFPlots. From the section in the manual titled Before you start with 3D: PGFPlots "cannot combine different \addplot commands, those will be drawn in the order of appearance"
    – Jake
    Dec 5, 2014 at 13:04
  • @jake okay, I found the passage. Then maybe I'll try to split the border set and plot the sets in correct order.
    – embert
    Dec 5, 2014 at 14:01


You must log in to answer this question.

Browse other questions tagged .