# Pgfplot 3Dsurface from CSV [duplicate]

I have already read Create a 3D figure (surf) from .csv file, 2D surface on a 3D surface plot external data in a file but nothing seems to work.

I have the following code:

\documentclass{standalone}
\usepackage{tikz}
\usepackage{filecontents}
\usepackage{pgfplots}
\pgfplotsset{compat=1.12}

\begin{document}
\begin{tikzpicture}
\begin{axis}
\end{axis}
\end{tikzpicture}

\end{document}


With the following data: data. When I compile, I get the following error:

! Package pgfplots Error: CRITICAL: shader=interp: got unsupported pdf shading
type '0'. This may corrupt your pdf!.


Which I don't understand. I have indicated the number of rows, so it should be OK right? Thanks a lot for the help.

edit: there are 4 columns per row in the data file as I would like to plot row 1, 2 and 3 as a 3d surface and use row 4 as a color, to represent the 4th dimension.

• Welcome to TeX.SE, what are you trying to plot here, I see 4 dimensions for a 3d plot, could you detail a more please. – Raaja Apr 12 '19 at 11:19
• Yes of course. I would like to plot the row 1, 2 and 3 as a surface and use the row 4 as a color, to represent the 4th dimension. – Jean Oudot Apr 12 '19 at 11:22
• Yup I have read this one, but it does not seem to solve my problem. – Jean Oudot Apr 12 '19 at 11:29

I don't know your data format regarding how you section your matrix into.

Therefore, I assumed that you matrix has 10 rows and the result is that each rows has 100 elements. Please note that the mesh/rows definition is not the same as the number of rows in your .csv.

\documentclass[tikz]{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}

TLDR: The data is not input in the right-way. If you segment your data properly and enter it properly you should get what you want :)