ich hoffe, dass ihr mir mit meinem Problem helfen könnt. Ich versuche mir mit Gnuplot eine Grafik zeichnen zu lassen. Den Code dafür habe ich mir von Geo-gebra ausgeben lassen. Ich möchte dabei aber unbedingt diesmal gnuplot verwenden. Nunja irgendwie kann mein editor (Texmaker) nicht auf Gnuplot zugreifen. Beim Compilieren erscheint die Meldung :
"Der befehl 'gnuplot' ist falsch geschrieben oder konnte nicht gefunden werden"
Danach bekomme ich die Warnung "Package pgf Warning: Plot data file `test.func0.table' not found. on input line"
Gnuplot ist installiert und die Umgebungsvariable ist auch gesetzt.
Wenn ich die test.func0.table manuell erstelle funktioniert alles! Will das aber nicht jedes mal per Hand machen müssen. Hab in Texmaker unter pdflatex "pdflatex -synctex=1 --enable-write18 -interaction=nonstopmode %.tex" eingestellt.
Mein system:
- Miktex 2.9
- gnuplot 5.0
- texmaker
\documentclass[10pt]{article} \usepackage{pgf,tikz} \usetikzlibrary{arrows} \pagestyle{empty} \begin{document} \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm] \draw[->,color=black] (-3,0) -- (5,0); \foreach \x in {-3,-2.5,-2,-1.5,-1,-0.5,0.5,1,1.5,2,2.5,3,3.5,4,4.5} \draw[shift={(\x,0)},color=black] (0pt,2pt) -- (0pt,-2pt) node[below] {\footnotesize $\x$}; \draw[color=black] (4.91,0.02) node [anchor=south west] { x}; \draw[->,color=black] (0,-2) -- (0,1.5); \foreach \y in {-2,-1.5,-1,-0.5,0.5,1} \draw[shift={(0,\y)},color=black] (2pt,0pt) -- (-2pt,0pt) node[left] {\footnotesize $\y$}; \draw[color=black] (0.03,1.37) node [anchor=west] { y}; \draw[color=black] (0pt,-10pt) node[right] {\footnotesize $0$}; \clip(-3,-2) rectangle (5,1.5); \draw plot[raw gnuplot, id=func0] function{set samples 100; set xrange [-2.9:4.9]; plot 2*x*2.718281828**(-x)}; \draw plot[raw gnuplot, id=func1] function{set samples 100; set xrange [-2.9:4.9]; plot 1/2*x-1}; \begin{scriptsize} \draw[color=black] (-0.5,-2.26) node {$f$}; \draw[color=black] (-2.86,-2.54) node {$g$}; \end{scriptsize} \end{tikzpicture} \end{document}