2

I have a plot of coordinates

\draw plot [smooth] coordinates{ (-3.1,-0.5) (-1.5,0.3) (0,0) (1.8,0.64) (3,0.5)};

Is there a way to have the curve between (0,0) and (1.8, 0.64) painted thick?

I would just draw a second plot, but of course the smoothing is different when I omitt data.

4

You could clip the second plot:

\documentclass[tikz,border=2mm]{standalone}

\begin{document}
    \begin{tikzpicture}
        \draw plot [smooth] coordinates{ (-3.1,-0.5) (-1.5,0.3) (0,0) (1.8,0.64) (3,0.5)};

        \begin{scope} 
            \clip(0,0) rectangle (1.8,0.64);
            \draw[thick] plot [smooth] coordinates{ (-3.1,-0.5) (-1.5,0.3) (0,0) (1.8,0.64) (3,0.5)};
        \end{scope}
    \end{tikzpicture}
\end{document}

enter image description here

  • In my case this works, but what if the plot intersects itself? Then this would leave the intersection visible. – BenjaminH Dec 30 '15 at 10:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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