[OS X TeX] Tikz loop question

Frank STENGEL fstengel at mac.com
Tue Jun 12 05:20:28 EDT 2007


Le 12 juin 07 à 10:35, Gary Church a écrit :

> Hello Tikz experts!
>
> I'm trying to do an apparently unusual thing (as I can't figure out  
> how to do this :-) )
>
> I've included the "calc" package to get inline mathematical  
> operations. What I want to do is the the color of my plots to be  
> based of the value of a looping variable. Consider the code  
> fragment below:

<snip>

>     \foreach \w in {1,...,5} \draw[thick,color=black!\w*10,<->] plot 
> [domain=-3:3]			%NOTE THIS LINE!
>     	function{x**2 - \w} node[right,red] {$y=x^2 - \w$};

<snap>

>
> On the indicated line with the comment you'll see "color = black! 
> \w*10". My intention is that the curves whose equations are:


What would work is \w0 (i.e. adding a  tailing 0 to the contents of  
w). As far as I can tell calc is not designed for what you want it to  
do. It was designed to handle calculations in counter/dimen  
assignements...

-- 
Frank STENGEL (fstengel<at>mac.com)


------------------------- Helpful Info -------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/
List Reminders & Etiquette: http://www.esm.psu.edu/mac-tex/list/





More information about the MacOSX-TeX mailing list