[OS X TeX] TikZ & PGF

Tim Brophy timbrophy at mac.com
Thu Mar 3 10:59:37 EST 2011


Can anyone out there explain why the following code does not work?

\documentclass[10pt]{article}
\usepackage{pgf,tikz}
\usetikzlibrary{arrows}
\pagestyle{empty}
\begin{document}
\definecolor{ffffff}{rgb}{1,1,1}
\definecolor{qqqqff}{rgb}{0,0,1}
\definecolor{ffqqqq}{rgb}{1,0,0}
\definecolor{zzttqq}{rgb}{0.6,0.2,0}
\definecolor{ffqqff}{rgb}{1,0,1}
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm]
\clip(-1.04,-0.62) rectangle (5.72,3.88);
\fill[color=ffqqff,fill=ffqqff,fill opacity=0.95] (1,1) -- (1.34,0) -- (3.72,0) -- (4,1) -- cycle;
\draw[color=ffqqqq,fill=ffqqqq,fill opacity=1.0] {[smooth,samples=50,domain=-1.0:2.44] plot(\x,{0-0.05\x^3+0.04\x^2-0.68\x+2.23})} -- (2.44,1) {[smooth,samples=50,domain=2.44:-1.0] -- plot(\x,{0-0.06\x^3-0.04\x^2-0.3\x+2.88})} -- (-1,3) -- cycle;
\draw[color=qqqqff,fill=qqqqff,fill opacity=1.0] {[smooth,samples=50,domain=2.7600000000000007:5.08] plot(\x,{0-0.11\x^4+1.71\x^3-10.8\x^2+32.19\x-35.49})} -- (5.08,3.24) {[smooth,samples=50,domain=5.08:2.7600000000000007] -- plot(\x,{0-0.8\x^3+9.46\x^2-34.92\x+41.63})} -- (2.76,1) -- cycle;
\fill[color=ffffff,fill=ffffff,fill opacity=1.0] (0,0) -- (5,0) -- (5,1) -- (0,1) -- cycle;
\draw [color=zzttqq] (1,1)-- (1.34,0);
\draw [color=zzttqq] (1.34,0)-- (3.72,0);
\draw [color=zzttqq] (3.72,0)-- (4,1);
\draw [color=zzttqq] (4,1)-- (1,1);
\draw[smooth,samples=100,domain=-1.0:1.6600000000000001] plot(\x,{0-0.05(\x)^3+0.04(\x)^2-0.68(\x)+2.23});
\draw[smooth,samples=100,domain=-1.0:2.44] plot(\x,{0-0.06(\x)^3-0.04(\x)^2-0.3(\x)+2.88});
\draw[smooth,samples=100,domain=2.7600000000000007:5.08] plot(\x,{0-0.11(\x)^4+1.71(\x)^3-10.8(\x)^2+32.19(\x)-35.49});
\draw[smooth,samples=100,domain=3.54:5.0600000000000005] plot(\x,{0-0.8(\x)^3+9.46(\x)^2-34.92(\x)+41.63});
\draw [color=ffffff] (0,0)-- (5,0);
\draw [color=ffffff] (5,0)-- (5,1);
\draw [color=ffffff] (5,1)-- (0,1);
\draw [color=ffffff] (0,1)-- (0,0);
\draw [color=ffqqqq](-0.54,3.68) node[anchor=north west] {$$x$$};
\draw [color=qqqqff](5.28,3.94) node[anchor=north west] {$$ y $$};
\draw [color=ffqqff](2.14,0.14) node[anchor=north west] {$$ x+y $$};
\end{tikzpicture}
\end{document}

An error message is returned that implies "samples" is broken down into two parts and the second part seems to be regardedas the name of a unit.

Help appreciated!

Tim Brophy



More information about the MacOSX-TeX mailing list