1

I would like to run this program but my output is only the axes themselves! I thought my MiKTeX console updates all softwares for my TeXnicCenter platform but apparently not since when I run this:

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
% use GNUplot (avaiable in TeXLive)
\draw[->] (-4.5,0) -- (4.5,0) node[below] {$x$};
\draw[->] (0,-4.5) -- (0,4.5) node[left] {$y$};

\draw[blue,thick] plot[raw gnuplot,smooth] function {
f(x,y) = x*y*y+2*(x**3)*(y**3)-y-1;
set xrange [-4:4];
set yrange [-4:4];
set view 0,0;
set isosample 500,500;
set cont base;
set cntrparam levels incre 0,0.1,0;
unset surface;
splot f(x,y);
 };
 \node[below=5mm,blue] at (current bounding box.south) 
  {The curve $xy^2+2x^3y^3=y+1$.};
 \end{tikzpicture}
 \end{document}

My Output is without plot:

enter image description here

Please advise my about GNUplot. This is a little confusing. I only found the following download page: https://sourceforge.net/projects/gnuplot/ I get confused with so many files!

MathScholar
  • 2,513
  • 2
    Although tikz provides gnuplot facilities or uses gnuplot, the installation of gnuplot is not really on-topic on TeX.SE. There is nothing difficult on selecting https://sourceforge.net/projects/gnuplot/files/gnuplot/5.2.6/gp526-win64-mingw_2.exe/download and download and run the self-extracting document. –  Jan 27 '19 at 15:15
  • @Christian Hupfer I see that tikz provides. I did the instruction above but no result in the pdf output. But I was able to run the code on their windows platform but not out put in a pdf in the article documentclass – MathScholar Jan 27 '19 at 15:25
  • Can you run gnuplot from the command line? – Jesse op den Brouw Jan 27 '19 at 15:40
  • Yes I just can not run in my TeXNicCenter editor and output as pdf – MathScholar Jan 27 '19 at 15:42
  • 3
    You have to run pdflatex with the option shell-escape otherwise it is not allowed to run an external program from within a pdflatex run –  Jan 27 '19 at 15:47
  • @Herbert, are you saying I need to add the package gnuplot-lua-tikz to my program files and run pdflatex so it gets picked-up by the editor? – MathScholar Jan 27 '19 at 15:52
  • No, in your editor you have to define how pdflatex or whatelse is run. For example for TeXstudio I have defined lualatex --shell-escape -interaction=nonstopmode %.tex Every Editor has it's own way to define such commands. –  Jan 27 '19 at 15:57
  • For Latex>PDF in TeXnicCenter it is -shell-escape -synctex=-1 -interaction=nonstopmode "%wm" It is best to copy Latex>PDF and edit a new profile via the Build options when adding -shell- escape simply call the profile a name like "with gnuplot" –  Jan 27 '19 at 15:59
  • Are you saying I have to redefine my output profile with that command line? Currently it reads -max-print-line=120 -interaction=nonstopmode "%wm" – MathScholar Jan 27 '19 at 16:06
  • I tried but it says cannot execute command ! I created a separate profile so I don't mess up my current settings – MathScholar Jan 27 '19 at 16:27
  • possible duplicate of https://tex.stackexchange.com/q/456362/138900 – AndréC Jan 27 '19 at 16:29
  • Try my stress test MWE for gnuplot at https://tex.stackexchange.com/a/456328/170109 –  Jan 27 '19 at 17:18
  • @AnderC I finally got it to work by accident. AnderC's comment helped plus I needed to compile first with KJO's suggestion then recompile again normally to output the pdf. . This is tough for me to understand as I am a rookie here – MathScholar Jan 27 '19 at 18:27

0 Answers0