3

Is there a way to plot line contours from a data file specifying the value of the line such as the one shown in example here. It takes a lot of time to plot, export and enter the PDF in to the thesis.

Contour of a fluid flow problem

Alenanno
  • 37,338
sgp
  • 351
  • How did you get these curves? – pluton May 31 '12 at 14:08
  • 4
  • 1
    Does the question percusse linked to answer your question? Then we can close this as a duplicate. If it doesn't, please add more information to your question. At the moment, all you could reasonably expect is an answer along the lines of "Yes, there's a way, but it depends." – Jake May 31 '12 at 14:56
  • Actually, the link provided by @percusse is not exactly what i need. What i want is that pgfplots should read the data from a file, then plot the specific contour line according to the value specified (labeling is only the next issue). Is this possible? – sgp Jun 01 '12 at 00:22
  • I can feel that it is possible but if you can give us some dummy data and a basic construction, we can understand better what you are doing. Right now, all I can see is bunch of plots and numbers attached to them which is not what you are describing in the your last comment. – percusse Jun 01 '12 at 00:27
  • 1
    Take a look at the manual, section 4.5.7 Contour Plots. – Jake Jun 01 '12 at 08:56
  • @Jake thanks for the info. Actually its a extension of this which i want. Ex: `\begin{tikzpicture}

    \begin{axis}[colormap/cool] \addplot3[surf,samples=25,domain=0:1,shader=flat] {x(1-x)y*(1-y)}; \end{axis}

    \end{tikzpicture}`

    In the above plot, i want the contour lines projected on to the ground for specific values of z-axis. @percusse Will this be enough?

    – sgp Jun 01 '12 at 09:09
  • @sgp: So do you want a perspective view, like in the example in your comment, or do you want a 2D view, like in the picture you posted in your question? – Jake Jun 01 '12 at 09:21
  • @Jake Actually both are fine. But my main aim is to show the contour lines on to the ground. In gnuplot, the command would look like, set contour unset clabel set view 0,0 unset surface set cntrparam levels 10 sp 'Plot.dat' w l u 1:2:3 – sgp Jun 01 '12 at 09:39
  • @sgp: So what's wrong with the first example, in section 4.5.7 of the manual, (\begin{axis}[view={0}{90}] \addplot3[contour gnuplot] {x*y}; \end{axis})? That should be exactly what you're asking. – Jake Jun 01 '12 at 09:42
  • @Jake I am very sorry for the inconvenience, my pgfplots package documents seem to be out of date. The example in 4.5.7 is different in my document to that of your link. – sgp Jun 01 '12 at 09:46
  • 1
    @sgp Thanks for the update. If you add \listfiles to your preamble, it will list the version info of each package in the .log file. If older than 1.5.1, I would recommend you to update to the latest (v1.5.1 currently) version. – percusse Jun 01 '12 at 10:18
  • @Jake For the pdf manual you point to,-- Revision 1.16 (2018/03/28)) -- the section for contour plots is 4.6.8 (eigth subsection of the "Three Dimensional Plot Types" section. – Jhor Aug 29 '18 at 10:06

0 Answers0