6

I'm new to LaTeX, and I'm trying to create 3D graph with 180 points. I tried to compile it, but after 25 minutes it still hadn't compiled, although my computer sounded like it was working quite hard.

I had been able to create a 3D graph for testing with only 6 points on it, so I don't think there's something wrong with the code.

There are also no error messages or warnings.

Is there a limit on how many points one can put on a graph, or is waiting a very long time for a 3d graph to compile supposed to happen?

\usepackage{pgfplots}


\begin{tikzpicture}
    \begin{axis}[xlabel style={align=right,text width=3cm}, 

    xlabel= Query Length (150-5000), 

    ylabel=Document Length (0-100), 

    zlabel=Time Taken (highest:16.22)]

        \addplot3[surf] coordinates {


%HSK 1 document length from 0-3000
%Returning 10 documents
(150, 100, 9.15)(150, 200, 9.91)(150, 300, 10.50)

(150, 400, 10.44) (150,500,10.53)  (150, 600, 9.37)

(150, 700, 15.04 ) (150, 800, 16.16) (150,900,18.00) 

( 150, 1000, 29.34 )(150, 1100, 28.12) (150,1200, 23.31)

(150, 1300, 22.62 )(150, 1400, 24.51 ) (150, 1500, 24.43 ) 

(150, 1600, 28.10 )( 150, 1700, 28.45 ) (150, 1800, 16.46 ) 

(150, 1900, 29.19 )(150,2000, 28.55 ) (150, 2100, 31.86 )

(150, 2200,33.02 ) (150, 2300, 33.69 ) (150, 2400, 33.40 )

(150, 2500, 33.00 ) (150, 2600, 33.65) (150, 2700, 32.51 )

(150, 2800,36.29 ) (150, 2900, 38.33 ) (150, 3000, 41.47 )





%HSK 2 document length from 0-3000
%Returning 10 documents

(300, 100,11.29 )(300, 200, 10.81 )(300, 300, 9.96 )

(300, 400, 12.02) (300,500, 14.03)  (300, 600, 15.24)

(300, 700, 18.22 ) (300, 800, 18.98 ) (300, 900, 18.56) 

( 300, 1000, 20.44) ( 300, 1100, 22.40 ) (300,1200, )

(300, 1300, 22.47 )(300, 1400, 24.95 ) (300, 1500,  25.43) 

(300, 1600, 26.87)( 300, 1700, 28.77 ) (300, 1800, 29.75 ) 

(300, 1900, 30.46 )(300,2000, 32.41 ) (300, 2100, 32.94 )

(300, 2200, 34.15 ) (300, 2300, 35.48 ) (300, 2400, 36.42)

(300, 2500, 36.05 ) (300, 2600, 36.00) (300, 2700, 37.59 )

(300, 2800, 38.57) (300, 2900, 39.11 ) (300, 3000, 40.77)





%HSK 3 document length from 0-3000
%Returning 10 documents

(600, 100, 11.47 )(600, 200, 10.89 )(600, 300, 10.96)

(600, 400, 13.98 ) (600,500, 15.66)  (600, 600, 16.09 )

(600, 700, 17.49 ) (600, 800, 19.65 ) (600, 900, 19.80 ) 

( 600, 1000, 21.04 ) ( 600, 1100, 22.85) (600,1200, 23.60 )

(600, 1300, 25.86  )(600, 1400, 26.58 ) (600, 1500,  27.73 ) 

(600, 1600, 30.21 )( 600, 1700, 30.14 ) (600, 1800, 30.99 ) 

(600, 1900, 31.77 )(600,2000, 32.21 ) (600, 2100, 33.89 )

(600, 2200, 34.95 ) (600, 2300, 35.59 ) (600, 2400, 35.76 )

(600, 2500, 36.87) (600, 2600, 37.14) (600, 2700, 38.42 )

(600, 2800, 38.01 ) (600, 2900, 42.47) (600, 3000, 41.63 )



%HSK 4 document length from 0-3000
%Returning 10 documents

(1200, 100, 11.82)(1200, 200, 12.02)(1200, 300,12.46 )

(1200, 400, 15.27) (1200,500, 16.91 )  (1200, 600, 16.80 )

(1200, 700, 18.65 ) (1200, 800, 19.86) (1200,900, 19.03) 

( 1200, 1000, 21.96 )(1200, 1100, 23.43 ) (1200,1200, 23.25 )

(1200, 1300, 23.83 )(1200, 1400,  26.29 ) (1200, 1500, 28.24) 

(1200, 1600, 29.88)( 1200, 1700, 30.34) (1200, 1800,31.60 )

(1200, 1900, 32.23)(1200,2000, 33.40 ) (1200, 2100, 34.00)

(1200, 2200, 34.52) (1200, 2300, 34.91) (1200, 2400,)

(1200, 2500, 35.70) (1200, 2600, 35.50) (1200, 2700, 35.24 )

(1200, 2800, 34.23) (1200, 2900, 35.41) (1200, 3000, 36.47)


%HSK 5 document length from 0-3000
%Returning 10 documents


(2500, 100,  13.97)(2500, 200, 11.00 )(2500, 300, 11.47 )

(2500, 400, 11.81 ) (2500,500, 11.46)  (2500, 600, 13.36 )

(2500, 700, 16.62 ) (2500, 800, 19.07) (2500, 900, 19.05)

( 2500, 1000, 22.25 ) ( 2500, 1100,  25.32) (2500,1200, 25.08)

(2500, 1300, 25.37 )(2500, 1400, 25.43) (2500, 1500, 29.30 ) 

(2500, 1600,27.89 )( 2500, 1700, 31.77 ) (2500, 1800, 31.86 ) 

(2500, 1900, 32.66 )(2500,2000, 34.85) (2500, 2100,36.96 )

(2500, 2200, 34.44 ) (2500, 2300, 36.54 ) (2500, 2400, 32.60)

(2500, 2500, 37.17 ) (2500, 2600, 38.71) (2500, 2700, 38.28)

(2500, 2800, 39.89 ) (2500, 2900, 42,10 ) (2500, 3000, 41.07)


%HSK 6 document length from 0-3000
%Returning 10 documents


(5000, 100, 14.28 )(5000, 200, 14.56 )(5000, 300, 13.62 )

(5000, 400, 14.74 ) (5000,500, 13.44)  (5000, 600, 14.83 )

(5000, 700, 20.38 ) (5000, 800, 20.11 ) (5000, 900, 24.16 )

( 5000, 1000, 19.48 ) ( 5000, 1100, 29.05 ) (5000,1200, 32.22 )

(5000, 1300, 21.83 )(5000, 1400,27.03 ) (5000, 1500, 28.55  ) 

(5000, 1600, 27.07 )( 5000, 1700,29.80 ) (5000, 1800, 35.65 )

(5000, 1900, 32.88)(5000,2000, 37.07 ) (5000, 2100, 37.88 )

(5000, 2200, 37.00 ) (5000, 2300, ) (5000, 2400, 40.86 )

(5000, 2500, 40.65 ) (5000, 2600, 41.50) (5000, 2700, 39.78)

(5000, 2800, 38.84 ) (5000, 2900, 43.30 ) (5000, 3000, 42.73 )


};
    \end{axis}
\end{tikzpicture}
  • 1
    Welcome to TeX.sx! You said it works with 6 points, but not with 180. Have you tried with 10, 15, 20, 50 points? If yes, does it take longer and longer? – T. Verron Sep 24 '14 at 10:27
6

If this is the code you are exactly compiling it's not a valid TeX document. If it is a part of a code then please post the whole thing. In this example, you have to remove the empty lines; some of them are not needed some of them lead to errors. Try for yourself

But the main problem is that you have missing data points, three as far as I can see are (300,1200, ) and (1200,2400,) and (5000,2300,). Either fill these entries or remove them accordingly and it should work.

If I randomly fix the problematic entries I get this

\documentclass{article}
\usepackage{pgfplots}

\begin{document}

\begin{tikzpicture}
    \begin{axis}[xlabel style={align=right,text width=3cm}, 
    xlabel= Query Length (150-5000), 
    ylabel=Document Length (0-100), 
    zlabel=Time Taken (highest:16.22)]

        \addplot3[surf] coordinates {
%HSK 1 document length from 0-3000
%Returning 10 documents
(150, 100, 9.15)(150, 200, 9.91)(150, 300, 10.50)
(150, 400, 10.44) (150,500,10.53)  (150, 600, 9.37)
(150, 700, 15.04) (150, 800, 16.16) (150,900,18.00) 
( 150, 1000, 29.34 )(150, 1100, 28.12) (150,1200, 23.31)
(150, 1300, 22.62 )(150, 1400, 24.51 ) (150, 1500, 24.43 ) 
(150, 1600, 28.10 )( 150, 1700, 28.45 ) (150, 1800, 16.46 ) 
(150, 1900, 29.19 )(150,2000, 28.55 ) (150, 2100, 31.86 )
(150, 2200,33.02 ) (150, 2300, 33.69 ) (150, 2400, 33.40 )
(150, 2500, 33.00 ) (150, 2600, 33.65) (150, 2700, 32.51 )
(150, 2800,36.29 ) (150, 2900, 38.33 ) (150, 3000, 41.47 )

%HSK 2 document length from 0-3000
%Returning 10 documents
(300, 100,11.29 )(300, 200, 10.81 )(300, 300, 9.96 )
(300, 400, 12.02) (300,500, 14.03)  (300, 600, 15.24)
(300, 700, 18.22 ) (300, 800, 18.98 ) (300, 900, 18.56) 
( 300, 1000, 20.44) ( 300, 1100, 22.40 ) (300,1200, 24.00)
(300, 1300, 22.47 )(300, 1400, 24.95 ) (300, 1500,  25.43) 
(300, 1600, 26.87)( 300, 1700, 28.77 ) (300, 1800, 29.75 ) 
(300, 1900, 30.46 )(300,2000, 32.41 ) (300, 2100, 32.94 )
(300, 2200, 34.15 ) (300, 2300, 35.48 ) (300, 2400, 36.42)
(300, 2500, 36.05 ) (300, 2600, 36.00) (300, 2700, 37.59 )
(300, 2800, 38.57) (300, 2900, 39.11 ) (300, 3000, 40.77)

%HSK 3 document length from 0-3000
%Returning 10 documents
(600, 100, 11.47 )(600, 200, 10.89 )(600, 300, 10.96)
(600, 400, 13.98 ) (600,500, 15.66)  (600, 600, 16.09 )
(600, 700, 17.49 ) (600, 800, 19.65 ) (600, 900, 19.80 ) 
( 600, 1000, 21.04 ) ( 600, 1100, 22.85) (600,1200, 23.60 )
(600, 1300, 25.86  )(600, 1400, 26.58 ) (600, 1500,  27.73 ) 
(600, 1600, 30.21 )( 600, 1700, 30.14 ) (600, 1800, 30.99 ) 
(600, 1900, 31.77 )(600,2000, 32.21 ) (600, 2100, 33.89 )
(600, 2200, 34.95 ) (600, 2300, 35.59 ) (600, 2400, 35.76 )
(600, 2500, 36.87) (600, 2600, 37.14) (600, 2700, 38.42 )
(600, 2800, 38.01 ) (600, 2900, 42.47) (600, 3000, 41.63 )

%HSK 4 document length from 0-3000
%Returning 10 documents
(1200, 100, 11.82)(1200, 200, 12.02)(1200, 300,12.46 )
(1200, 400, 15.27) (1200,500, 16.91 )  (1200, 600, 16.80 )
(1200, 700, 18.65 ) (1200, 800, 19.86) (1200,900, 19.03) 
(1200, 1000, 21.96 )(1200, 1100, 23.43 ) (1200,1200, 23.25 )
(1200, 1300, 23.83 )(1200, 1400,  26.29 ) (1200, 1500, 28.24) 
(1200, 1600, 29.88)( 1200, 1700, 30.34) (1200, 1800,31.60 )
(1200, 1900, 32.23)(1200,2000, 33.40 ) (1200, 2100, 34.00)
(1200, 2200, 34.52) (1200, 2300, 34.91) (1200, 2400,35)
(1200, 2500, 35.70) (1200, 2600, 35.50) (1200, 2700, 35.24 )
(1200, 2800, 34.23) (1200, 2900, 35.41) (1200, 3000, 36.47)

%HSK 5 document length from 0-3000
%Returning 10 documents
(2500, 100,  13.97)(2500, 200, 11.00 )(2500, 300, 11.47 )
(2500, 400, 11.81 ) (2500,500, 11.46)  (2500, 600, 13.36 )
(2500, 700, 16.62 ) (2500, 800, 19.07) (2500, 900, 19.05)
(2500, 1000, 22.25 ) ( 2500, 1100,  25.32) (2500,1200, 25.08)
(2500, 1300, 25.37 )(2500, 1400, 25.43) (2500, 1500, 29.30 ) 
(2500, 1600,27.89 )( 2500, 1700, 31.77 ) (2500, 1800, 31.86 ) 
(2500, 1900, 32.66 )(2500,2000, 34.85) (2500, 2100,36.96 )
(2500, 2200, 34.44 ) (2500, 2300, 36.54 ) (2500, 2400, 32.60)
(2500, 2500, 37.17 ) (2500, 2600, 38.71) (2500, 2700, 38.28)
(2500, 2800, 39.89 ) (2500, 2900, 42.10 ) (2500, 3000, 41.07)

%%HSK 6 document length from 0-3000
%%Returning 10 documents
(5000, 100, 14.28 )(5000, 200, 14.56 )(5000, 300, 13.62 )
(5000, 400, 14.74 ) (5000,500, 13.44)  (5000, 600, 14.83 )
(5000, 700, 20.38 ) (5000, 800, 20.11 ) (5000, 900, 24.16 )
( 5000, 1000, 19.48 ) ( 5000, 1100, 29.05 ) (5000,1200, 32.22 )
(5000, 1300, 21.83 )(5000, 1400,27.03 ) (5000, 1500, 28.55  ) 
(5000, 1600, 27.07 )( 5000, 1700,29.80 ) (5000, 1800, 35.65 )
(5000, 1900, 32.88)(5000,2000, 37.07 ) (5000, 2100, 37.88 )
(5000, 2200, 37.00 ) (5000, 2300,39 ) (5000, 2400, 40.86 )
(5000, 2500, 40.65 ) (5000, 2600, 41.50) (5000, 2700, 39.78)
(5000, 2800, 38.84 ) (5000, 2900, 43.30 ) (5000, 3000, 42.73 )
};
\end{axis}
\end{tikzpicture}

\end{document}

enter image description here

  • Shouldn't the entry of highest: be some kind of value of \pgfkeysvalueof, determined by the input? Correct me if I'm wrong. – 1010011010 Sep 24 '14 at 10:46
  • Thanks so much for the help!! Didn't note the missing data points, and didn't know space can cause hassle in LaTeX! Sorry, I can't upvote your question as I don't have the 15 reputation required. – AnonyMouse Sep 24 '14 at 10:56
  • @1010011010 If the input was a table we might have figured it out by the column data before drawing but this is built on the fly so it would be too late to set the key after reading all points (or that's my impression). – percusse Sep 24 '14 at 11:56

Your Answer

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

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