Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Nothing I'm doing is allowing me to get a compilable, decorated path.

The MWE shows two attempts

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.text}
\begin{document}

\begin{tikzpicture}
  \draw[help lines] grid (3,2);
  \fill [draw=red,
         fill=red!20,
         postaction={decorate,
                     decoration={raise=2pt,
                                 text along path,
                                 text={this, is my text asldfj some more text and yet more text to come and even more test to come this, is my text asldfj some more text and yet more text to come and even more test to come}
                                }}] 
                     plot[domain=-4:4,parametric] function{t,t*t};
%% this fails too %% plot[domain=-4:4,parametric] ({t},{t*t});
\end{tikzpicture}

\end{document}

As it currently stands, I get the error:

Package pgf Warning: Plot data file `mwe_01.pgf-plot.table' not found. on input
 line 16.


! Package pgf Error: I cannot decorate an empty path.

See the pgf package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.16 ...t[domain=-4:4,parametric] function{t,t*t};

If I reverse which plot lines are commented out, I get the error:

! Package PGF Math Error: Unknown function `t' (in 't').

See the PGF Math package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.17     plot[domain=-4:4,parametric] ({t},{t*t})
                                                 ;
? 

Currently the manual is driving me crazy. Examples are hard to use because for very few of them is it clear what libraries need to be called. For example, it took a long time to figure out that \usetikzlibrary{decorations} wasn't sufficient. It then took me another century to figure out which decoration libraries I needed. :(::::::::::::::::::::::::::

I'm sure the solution to decorating a parameterized path is straight-forward. It might even be documented in the manual. But, after search for way too long, I can find nothing that's helping me. :(

Any suggestions?

share|improve this question
1  
Actually, \x is the default variable, which can be changed. Just add variable=\t into the draw options, say, following the fill option. Your commented out plot would work if \t is used instead. –  Jesse Sep 11 '13 at 6:46
add comment

1 Answer

This works:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.text}
\begin{document}

\begin{tikzpicture}
  \draw[help lines] grid (3,2);
  \fill [draw=red,
         fill=red!20,
         postaction={decorate,
                     decoration={raise=2pt,
                                 text along path,
                                 text={this, is my text asldfj some more text and yet more text to come and even more test to come this, is my text asldfj some more text and yet more text to come and even more test to come}
                                }}]
                     plot[domain=-4:4,parametric] ({\x},{(\x*\x)}); % or ({\x}, {(\x)^2})
%% this fails too %% plot[domain=-4:4,parametric] ({t},{t*t});
\end{tikzpicture}

\end{document}

enter image description here

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.