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.

Is there a way to properly branch a line into several lines in TikZ? Simply adding paths creates a darkening artifact where the paths overlap:

\begin{tikzpicture}[very thin,-stealth]
  \draw (-1, 0) -- (2, 0);
  \draw (0, 0) .. controls (1, 0) and (1, 0) .. (1, 1);
  \draw (0, 0) .. controls (1, 0) and (1, 0) .. (1, -1);
\end{tikzpicture}

Darkening artifact

I suppose this is due to subpixel rendering and antialiasing in the PDF reader... No artifact is visible on a laser printer output, but on screen rendering is also important so I wonder if there is any way to solve this problem.

Do the PDF or PostScript formats support specifying branching lines as a single object? Any idea for a workaround?

share|improve this question
2  
the obvious thing is to draw from the beginning of the line so that it will be rendered and anti-aliased all the way: \draw (-1,0) -- (0,0) .... However, as it is a visual effect of the PDF-reader it will be very hard to consider all renderers and each of their quirks. I.e. they will not render the display in the same manor making it impossible for you to achieve a consistent view across, platform, viewer, viewer-settings etc. –  zeroth Mar 12 '12 at 10:11
1  
Starting the three lines at (-1, 0) makes the artifact less obvious but the left part of the horizontal line will still be darker than the right part and the up and down shoots... –  Jeremie Mar 12 '12 at 10:30
    
Yes, but it is the only thing that I can think of. The PS does not have specification for such arbitrary line structures (to my knowledge). As I stated it will be very hard to circumvent this, if possible at all! –  zeroth Mar 12 '12 at 10:43

1 Answer 1

Would something like this help:

\input tikz
\tikzpicture
  \draw (0,0) -- +(3,0)
    {[-stealth]
    edge[out=0,in=270] (4,2)
    edge[out=0,in=90] (4,-2)
    edge (6,0)
    };
\endtikzpicture
\bye

enter image description here

share|improve this answer
    
Correct me if I'm wrong, but this works by minimizing the segment length where the three lines are overlapping. When one encounters this problem, it is certainly an option to change the shape of the lines to minimize this artifact. However I wonder if there is a way to remove the artefact while keeping the line shapes the same... –  Jeremie Apr 30 '12 at 16:34
    
@Jeremie: I don't know if there is, sorry. –  morbusg May 6 '12 at 12:06

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.