1

I am currently trying to get a nice smooth 3D plot using tikz, however, I am failing to do so in only one case. The complied file is smooth in most areas, yet, in the "peal" areas, the plot gets somewhat ripped apart. The example code is posted below, the data file is available at http://txt.do/dze2q due to length. I alread tryed various things, such as patch refines and shader = interp to get rid of the problem, however, nothing helps. I would be glad if anyone had a solution.

\documentclass{standalone}
\usepackage{tikz}
\usepackage{pgfplots}
\begin{document}
    \begin{tikzpicture}
        \begin{axis}[
        view={25}{35},
        width=12cm, height=10cm,
        zmin=0,
        zmax=6,
        z buffer=sort,
        xlabel={$\Theta $},
        ylabel={$\lambda_0$},
        zlabel={$MSE^{-1}$},
        xlabel style={sloped}, ylabel style={sloped}, zlabel style={sloped},
        ytick={0.2,0.4,0.6,0.8,1}, yticklabels={0.2,0.4,0.6,0.8,1},
        xtick={0.2,0.4,0.6,0.8,1}, xticklabels={0.2,0.4,0.6,0.8,1},
        point meta min=0, point meta max=6
        ]

            \addplot3[surf, miter limit=1, shader=faceted, faceted color=black!80, point meta=z] table {../data/vsmgwMse.txt};

        \end{axis}

    \end{tikzpicture}
\end{document}

Currently, the result looks like the picture below. As clearly visible, the "peak" regions are broken.

Current result

  • Welcome to TeX.SX! Could you edit your question and show us your current result. Then it is easier to see what "problem" you have. – Stefan Pinnow Aug 12 '18 at 11:59
  • Thanks for your suggestion, I tried to make the issue clearer by uploading a figure depicting the problem. – Michael Niedermeier Aug 13 '18 at 8:35
  • Thank you for adding the image. So it is just a guess, but I think you did some calculations in an external program which were exported to the data file, right? If so, try to increase the sample points. This should lead to a smoother surface. – Stefan Pinnow Aug 13 '18 at 17:53
  • You are right, the calculations are indeed performed externally. However, the source data the calculations are based upon is already extremely fine granular (we are speaking of millions of data points). While the data is aggregated in the calculation process to yield the plotted results, the source data cannot be obtained in higher resolution any more. – Michael Niedermeier Aug 14 '18 at 9:46

Your Answer

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

Browse other questions tagged or ask your own question.