6

How to draw different parts of a line in different colours. In the following code can each part of the line be drawn in different colour

    \documentclass{beamer}
\beamertemplatenavigationsymbolsempty
\usepackage{tikz}
\usepackage{pgfplots}
\begin{document}
\begin{frame}[fragile,t]
\frametitle{}
{
\begin{tikzpicture}
\draw [thick, green] (2.3,1.4) +(-27:2.2cm)-- +(153:2.2cm) +(42:1.88cm) -- +(-138:1.88cm);
\end{tikzpicture}
}
\end{frame}
\end{document}
  • Could you please specify how you would like the output to be? – zyy Jun 25 '18 at 18:25
5

Using edge could perhaps be an option.

enter image description here

\documentclass{beamer}
\beamertemplatenavigationsymbolsempty
\usepackage{pgfplots}
\begin{document}
\begin{frame}[fragile,t]
\frametitle{}
{
\begin{tikzpicture}
\draw [thick, green] (2.3,1.4) +(-27:2.2cm) edge +(153:2.2cm) +(42:1.88cm) edge[blue] +(-138:1.88cm);
\end{tikzpicture}
}
\end{frame}
\end{document}

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.