I want to draw a line or path with dashed line style at its begining and a solid line at the end, but in only one path (I mean, not drawing two path), something like :
\documentclass{minimal}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw (3,0) -- (1,0)[dashed] -- (0,0)[solid] ;
\end{tikzpicture}
\end{document}
Best Answer
If those are to be straight line segments, it couldn't get any simpler. It gets interesting with curves. Enclosed are a few examples, and I agree - it's too complicated. Clipping is the most accurate way to tell where the solid part should stop, but it requires its own scope. Fading is good for smooth transition but probably would only give headache if the path doesn't run more or less in one direction.
I'm quite sure there is a way to have a procedural stroke of the path, but I haven't found any information about that so far. I would personally enjoy a simple style that allows to easily morph the line type from start until end of a path, doing something similar to the second custom dash pattern but without all the typing. But for now, this is what I did: